<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html manifest="app.manifest">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
  <meta name="apple-mobile-web-app-capable" content="yes"/>

  <link rel="apple-touch-startup-image" href="%appbootimage%"/>
  <link rel="apple-touch-icon" href="%appicon%"/>

  <meta name="format-detection" content="telephone=yes"/>

  <meta name="viewport" content="width=device-width, maximum-scale=1.0, initial-scale=1.0, user-scalable=no"/>

  <style>%stylecode%</style>
  <title>TouchLog</title>

  <script type="text/javascript">
  /* This prevents the window being moved by touches,
     to give the impression of a native app */
  document.ontouchmove = function(e)
  { e.preventDefault(); }
  </script>

  <script type="text/javascript">
    window.onload = function()
    {
      function myApp() {
        var $R = [
	"Method %s in class %s threw exception [%s]",
	"Procedure %s threw exception [%s]",
	"Internal tag-object is null error",
	"Failed to create internal tag-object",
	"Invalid tag handle error",
	"Invalid attribute-name error",
	"Invalid property-name error",
	"Invalid style-name error",
	"Failed to attach element to owner",
	"Owner tag-object is NIL error",
	"invalid owner handle error",
	"Invalid component registration",
	"invalid owner handle error",
	"Failed to initialize from graphics-context: "];
function Trunc(v) { return (v>=0)?Math.floor(v):Math.ceil(v) };
function Trim$_String_Integer_Integer_(s,a,b) { if (a<0) a=0; if (b<0) b=0; return s.substr(a,s.length-a-b) };
function Trim$_String_(s) { return s.replace(/^\s\s*/, "").replace(/\s\s*$/, "") };
var TObject={
	$ClassName: "TObject",
	$Parent: null,
	ClassName: function (s) { return s.$ClassName },
	ClassType: function (s) { return s },
	ClassParent: function (s) { return s.$Parent },
	$Init: function () {},
	Create: function (s) { return s },
	Destroy: function (s) { for (var prop in s) if (s.hasOwnProperty(prop)) delete s.prop },
	Destroy$: function(s) { return s.ClassType.Destroy(s) },
	Free: function (s) { if (s!==null) s.ClassType.Destroy(s) }
};
function Now() { var d=new Date(); return d.getTime()/8.64e7+25569 };
function IntToHex2(v) { var r=v.toString(16); return (r.length==1)?"0"+r:r };
/**
sprintf() for JavaScript 0.7-beta1
http://www.diveintojavascript.com/projects/javascript-sprintf

Copyright (c) Alexandru Marasteanu <alexaholic [at) gmail (dot] com>
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
    * Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright
      notice, this list of conditions and the following disclaimer in the
      documentation and/or other materials provided with the distribution.
    * Neither the name of sprintf() for JavaScript nor the
      names of its contributors may be used to endorse or promote products
      derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL Alexandru Marasteanu BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
**/

var sprintf = (function() {
	function get_type(variable) {
		return Object.prototype.toString.call(variable).slice(8, -1).toLowerCase();
	}
	function str_repeat(input, multiplier) {
		for (var output = []; multiplier > 0; output[--multiplier] = input) {/* do nothing */}
		return output.join('');
	}

	var str_format = function() {
		if (!str_format.cache.hasOwnProperty(arguments[0])) {
			str_format.cache[arguments[0]] = str_format.parse(arguments[0]);
		}
		return str_format.format.call(null, str_format.cache[arguments[0]], arguments);
	};

	str_format.format = function(parse_tree, argv) {
		var cursor = 1, tree_length = parse_tree.length, node_type = '', arg, output = [], i, k, match, pad, pad_character, pad_length;
		for (i = 0; i < tree_length; i++) {
			node_type = get_type(parse_tree[i]);
			if (node_type === 'string') {
				output.push(parse_tree[i]);
			}
			else if (node_type === 'array') {
				match = parse_tree[i]; // convenience purposes only
				if (match[2]) { // keyword argument
					arg = argv[cursor];
					for (k = 0; k < match[2].length; k++) {
						if (!arg.hasOwnProperty(match[2][k])) {
							throw(sprintf('[sprintf] property "%s" does not exist', match[2][k]));
						}
						arg = arg[match[2][k]];
					}
				}
				else if (match[1]) { // positional argument (explicit)
					arg = argv[match[1]];
				}
				else { // positional argument (implicit)
					arg = argv[cursor++];
				}

				if (/[^s]/.test(match[8]) && (get_type(arg) != 'number')) {
					throw(sprintf('[sprintf] expecting number but found %s', get_type(arg)));
				}
				switch (match[8]) {
					case 'b': arg = arg.toString(2); break;
					case 'c': arg = String.fromCharCode(arg); break;
					case 'd': arg = String(parseInt(arg, 10)); if (match[7]) { arg = str_repeat('0', match[7]-arg.length)+arg } break;
					case 'e': arg = match[7] ? arg.toExponential(match[7]) : arg.toExponential(); break;
					case 'f': arg = match[7] ? parseFloat(arg).toFixed(match[7]) : parseFloat(arg); break;
					case 'o': arg = arg.toString(8); break;
					case 's': arg = ((arg = String(arg)) && match[7] ? arg.substring(0, match[7]) : arg); break;
					case 'u': arg = Math.abs(arg); break;
					case 'x': arg = arg.toString(16); break;
					case 'X': arg = arg.toString(16).toUpperCase(); break;
				}
				arg = (/[def]/.test(match[8]) && match[3] && arg >= 0 ? '+'+ arg : arg);
				pad_character = match[4] ? match[4] == '0' ? '0' : match[4].charAt(1) : ' ';
				pad_length = match[6] - String(arg).length;
				pad = match[6] ? str_repeat(pad_character, pad_length) : '';
				output.push(match[5] ? arg + pad : pad + arg);
			}
		}
		return output.join('');
	};

	str_format.cache = {};

	str_format.parse = function(fmt) {
		var _fmt = fmt, match = [], parse_tree = [], arg_names = 0;
		while (_fmt) {
			if ((match = /^[^\x25]+/.exec(_fmt)) !== null) {
				parse_tree.push(match[0]);
			}
			else if ((match = /^\x25{2}/.exec(_fmt)) !== null) {
				parse_tree.push('%');
			}
			else if ((match = /^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fosuxX])/.exec(_fmt)) !== null) {
				if (match[2]) {
					arg_names |= 1;
					var field_list = [], replacement_field = match[2], field_match = [];
					if ((field_match = /^([a-z_][a-z_\d]*)/i.exec(replacement_field)) !== null) {
						field_list.push(field_match[1]);
						while ((replacement_field = replacement_field.substring(field_match[0].length)) !== '') {
							if ((field_match = /^\.([a-z_][a-z_\d]*)/i.exec(replacement_field)) !== null) {
								field_list.push(field_match[1]);
							}
							else if ((field_match = /^\[(\d+)\]/.exec(replacement_field)) !== null) {
								field_list.push(field_match[1]);
							}
							else {
								throw('[sprintf] huh?');
							}
						}
					}
					else {
						throw('[sprintf] huh?');
					}
					match[2] = field_list;
				}
				else {
					arg_names |= 2;
				}
				if (arg_names === 3) {
					throw('[sprintf] mixing positional and named placeholders is not (yet) supported');
				}
				parse_tree.push(match);
			}
			else {
				throw('[sprintf] huh?');
			}
			_fmt = _fmt.substring(match[0].length);
		}
		return parse_tree;
	};

	return str_format;
})();
function Format(f,a) { a.unshift(f); return sprintf.apply(null,a) };
;
;
function FloatToStr$_Float_(i) { return i.toString() }
function FloatToStr$_Float_Integer_(i,p) { return (p==99)?i.toString():i.toFixed(p) };
var Exception={
	$ClassName: "Exception",
	$Parent: TObject,
	$Init: function () { FMessage="" },
	Create: function (s,Msg) { s.FMessage=Msg; return s }
};
function Delete(s,i,n) { var v=s.v; if ((i<=0)||(i>v.length)||(n<=0)) return; s.v=v.substr(0,i-1)+v.substr(i+n-1); };
function ClampInt(v,mi,ma) { return v<mi ? mi : v>ma ? ma : v };
function $W(e) { return e.ClassType?e:Exception.Create($New(Exception),e.constructor.name+", "+e.message) };
function $NewDyn(c,z) {
	if (c==null) throw Exception.Create($New(Exception),"ClassType is nil"+z);
	var i={ClassType:c};
	c.$Init(i);
	return i
};
function $New(c) { var i={ClassType:c}; c.$Init(i); return i };
function $Is(o,c) {
	if (o===null) return false;
	return $Inh(o.ClassType,c);
}
;
function $Inh(s,c) {
	if (s===null) return false;
	while ((s)&&(s!==c)) s=s.$Parent;
	return (s)?true:false;
}
;
function $Event2(i,f) {
	var li=i,lf=f;
	return function(a,b) {
		return lf.call(li,li,a,b)
	}
};
function $Event1(i,f) {
	var li=i,lf=f;
	return function(a) {
		return lf.call(li,li,a)
	}
};
function $Event0(i,f) {
	var li=i,lf=f;
	return function() {
		return lf.call(li,li)
	}
};
function $Event(i,f) {
	var li=i,lf=f;
	return function(){
		var arg=Array.prototype.slice.call(arguments);
		arg.unshift(li);
		return lf.apply(li,arg)
	}
};
function $Div(a,b) { var r=a/b; return (r>=0)?Math.floor(r):Math.ceil(r) };
function $AsClass(s,c) {
	if ((s===null)||$Inh(s,c)) return s;
	throw Exception.Create($New(Exception),"Cannot cast class \""+s.$ClassName+"\" to class \""+c.$ClassName+"\"");
};
function $As(o,c) {
	if ((o===null)||$Is(o,c)) return o;
	throw Exception.Create($New(Exception),"Cannot cast instance of type \""+o.ClassType.$ClassName+"\" to class \""+c.$ClassName+"\"");
};
function $ArraySwap(a,i1,i2) { var t=a[i1]; a[i1]=a[i2]; a[i2]=t };
function WriteLn(value$2) {
   if (window.console) {
      window.console.log(value$2);
   }
};
function w3_setStyle(tagRef, aStyleName, aStyleValue) {
   if (tagRef) {
      tagRef.style[aStyleName] = aStyleValue;
   }
};
function w3_setProperty(tagRef$1, aPropName, aValue) {
   tagRef$1[aPropName] = aValue;
};
function w3_setElementParentByRef(aElement, aParent) {
   if (VarIsValidRef(aParent)) {
      if (VarIsValidRef(aElement)) {
         aParent.appendChild(aElement);
      } else {
         throw Exception.Create($New(Exception),"Failed to add element to parent, element is null");
      }
   }
};
function w3_setCssStyle(tagRef$2, aStyleName$1, aStyleValue$1) {
   tagRef$2.style.setProperty(aStyleName$1,aStyleValue$1);
};
function w3_setAttrib(tagRef$3, aAttribName, aValue$1) {
   if (tagRef$3) {
      tagRef$3.setAttribute(aAttribName,aValue$1);
   }
};
function w3_RequestAnimationFrame(aMethod) {
   var Result = undefined;
   if (!vRequestAnimFrame) {
      InitAnimationFrameShim();
   }
   Result = vRequestAnimFrame(aMethod);
   return Result
};
function w3_RemoveEvent(a_tagRef, a_eventName, a_callback, a_useCapture) {
   if (a_eventName=="mousewheel") {
      a_eventName = "DOMMouseScroll";
   }
   a_tagRef.removeEventListener(a_eventName,a_callback,a_useCapture);
};
function w3_RemoveElementByRef(aElement$1, aParent$1) {
   if (aParent$1) {
      aParent$1.removeChild(aElement$1);
   }
};
function w3_RemoveClass(tagRef$4, aClassName) {
   var reg = undefined;
   if (w3_HasClass(tagRef$4,aClassName)) {
      
      reg = new RegExp("(\\s|^)" + aClassName + "(\\s|$)");
      (tagRef$4).className=(tagRef$4).className.replace(reg," ").replace('  ',' ').trim();
       }
};
function w3_RegisterBrowserAPI(aDriver) {
   vDriver = aDriver;
};
function w3_NameToUrlStr(aUrl) {
   var Result = "";
   Result = "url("+aUrl+")";
   return Result
};
function w3_HasClass(tagRef$5, aClassName$1) {
   var Result = false;
   
    Result = ((tagRef$5).className.match(new RegExp("(\\s|^)"+aClassName$1+"(\\s|$)")))?true:false;
  return Result
};
function w3_GetUniqueObjId() {
   var Result = "";
   ++vUniqueNumber;
   Result = "OBJ"+vUniqueNumber.toString();
   return Result
};
function w3_GetUniqueNumber() {
   var Result = 0;
   ++vUniqueNumber;
   Result = vUniqueNumber;
   return Result
};
function w3_getStyleAsStr(tagRef$6, aStyleName$2) {
   var Result = "";
   var mData;
   mData = w3_getStyle(tagRef$6,aStyleName$2);
   if (TVariant.IsString(mData)) {
      Result = TVariant.AsString(mData);
   } else if (TVariant.IsNumber(mData)) {
      Result = TVariant.AsInteger(mData).toString();
   }
   return Result
};
function w3_getStyleAsInt(tagRef$7, aStyleName$3) {
   var Result = 0;
   var mData$1;
   mData$1 = w3_getStyle(tagRef$7,aStyleName$3);
   if (TVariant.IsNumber(mData$1)) {
      Result = parseInt(mData$1,10);
   } else if (TVariant.IsString(mData$1)) {
      Result = parseInt(mData$1,10);
   }
   if (isNaN(Result)) {
      Result = 0;
   }
   return Result
};
function w3_getStyleAsFloat(tagRef$8, aStyleName$4) {
   var Result = 0;
   var mData$2 = undefined;
   mData$2 = w3_getStyle(tagRef$8,aStyleName$4);
   if (VarIsValidRef(mData$2)) {
      try {
         if (TVariant.IsNumber(mData$2)) {
            Result = TVariant.AsFloat(mData$2);
            if (isNaN(Result)) {
               Result = 0;
            }
         } else if (TVariant.IsString(mData$2)) {
            Result = Number(mData$2);
            if (isNaN(Result)) {
               Result = 0;
            }
         }
      } catch ($e) {
         var e = $W($e);
         /* null */
      }
   }
   return Result
};
function w3_getStyle(tagRef$9, aStyleName$5) {
   var Result = undefined;
   var mObj = undefined;
   mObj = document.defaultView.getComputedStyle(tagRef$9,null);
   if (mObj) {
      Result = mObj.getPropertyValue(aStyleName$5);
   }
   return Result
};
function w3_getPropertyAsStr(tagRef$10, aPropName$1) {
   var Result = "";
   if (tagRef$10) {
      Result = ""+tagRef$10[aPropName$1];
   }
   return Result
};
function w3_getPropertyAsInt(tagRef$11, aPropName$2) {
   var Result = 0;
   if (tagRef$11) {
      Result = parseInt(tagRef$11[aPropName$2],10);
   }
   return Result
};
function w3_getPropertyAsBool(tagRef$12, aPropName$3) {
   var Result = false;
   if (tagRef$12) {
      Result = (tagRef$12[aPropName$3]?true:false);
   }
   return Result
};
function w3_getIsSafari() {
   var Result = false;
   
    if (navigator.userAgent.match(/Safari/i)) Result=true;
  return Result
};
function w3_getIsOpera() {
   var Result = false;
   
    if (navigator.userAgent.match(/Opera/i)) Result=true;
  return Result
};
function w3_getIsIPod() {
   var Result = false;
   
    if (navigator.userAgent.match(/iPod/i)) Result=true;
  return Result
};
function w3_getIsIPhone() {
   var Result = false;
   
    if (navigator.userAgent.match(/iPhone/i)) Result=true;
  return Result
};
function w3_getIsIPad() {
   var Result = false;
   
    if (navigator.userAgent.match(/iPad/i)) Result=true;
  return Result
};
function w3_getIsInternetExplorer() {
   var Result = false;
   
    if (navigator.userAgent.match(/MSIE/i)) Result=true;
  return Result
};
function w3_getIsFirefox() {
   var Result = false;
   
    if (navigator.userAgent.match(/Firefox/i)) Result=true;
  return Result
};
function w3_getIsChrome() {
   var Result = false;
   
    if (navigator.userAgent.match(/Chrome/i)) Result=true;
  return Result
};
function w3_getIsAndroid() {
   var Result = false;
   
    if (navigator.userAgent.match(/Android/i)) Result=true;
  return Result
};
function w3_getCssStyleAsInteger(tagRef$13, aStyleName$6) {
   var Result = 0;
   var Value$1;
   Value$1 = w3_getCssStyle(tagRef$13,aStyleName$6);
   if (TVariant.IsNumber(Value$1)) {
      Result = parseInt(Value$1,10);
   } else if (TVariant.IsString(Value$1)) {
      Result = parseInt(""+Value$1,10);
   }
   if (isNaN(Result)) {
      Result = 0;
   }
   return Result
};
function w3_getCssStyle(tagRef$14, aStyleName$7) {
   var Result = undefined;
   Result = tagRef$14.style.getPropertyValue(aStyleName$7);
   return Result
};
function w3_getAttribAsStr(tagRef$15, aAttribName$1) {
   var Result = "";
   var mValue;
   mValue = tagRef$15.getAttribute(aAttribName$1,0);
   if (mValue) {
      Result = ""+mValue;
   }
   return Result
};
function w3_getAttrib(tagRef$16, aAttribName$2) {
   var Result = undefined;
   if (tagRef$16) {
      Result = tagRef$16.getAttribute(aAttribName$2);
   }
   return Result
};
function w3_DOMReady() {
   var Result = false;
   Result = document.readyState=="complete";
   return Result
};
function w3_CSSPrefixDef(aCSS) {
   var Result = "";
   Result = "-"+BrowserAPI().FCSSToken+"-"+aCSS;
   return Result
};
function w3_CSSPrefix(aCSS$1) {
   var Result = "";
   Result = BrowserAPI().FCSSToken+aCSS$1;
   return Result
};
function w3_createHtmlElement(aTypeName) {
   var Result = undefined;
   Result = document.createElement(aTypeName);
   return Result
};
function w3_bind2(obj_ref, event_name, callback) {
   obj_ref[event_name] = callback;
};
function w3_AddEvent(a_tagRef$1, a_eventName$1, a_callback$1, a_useCapture$1) {
   if (a_eventName$1=="mousewheel") {
      a_eventName$1 = "DOMMouseScroll";
   }
   a_tagRef$1.addEventListener(a_eventName$1,a_callback$1,a_useCapture$1);
};
function w3_AddClass(tagRef$17, aClassName$2) {
   if (!w3_HasClass(tagRef$17,aClassName$2)) {
      tagRef$17.className+=" "+aClassName$2;
   }
};
/// TW3CustomBrowserAPI = class (TObject)
///  [line: 51, column: 3, file: SmartCL.System]
var TW3CustomBrowserAPI = {
   $ClassName:"TW3CustomBrowserAPI",
   $Parent:TObject
   ,$Init:function ($) {
      TObject.$Init($);
      $.FCSSAnimation = $.FCSSBackgroundColor = $.FCSSBackgroundImage = $.FCSSBackgroundPos = $.FCSSBackgroundSize = $.FCSSToken = $.FCSSTransform = "";
   }
   /// function TW3CustomBrowserAPI.DevicePixelRatio() : Float
   ///  [line: 418, column: 36, file: SmartCL.System]
   ,DevicePixelRatio:function() {
      var Result = 0;
      
   Result = window.devicePixelRatio || 1;
   return Result
   }
   ,Destroy:TObject.Destroy
};
/// TW3WebkitBrowserAPI = class (TW3CustomBrowserAPI)
///  [line: 99, column: 3, file: SmartCL.System]
var TW3WebkitBrowserAPI = {
   $ClassName:"TW3WebkitBrowserAPI",
   $Parent:TW3CustomBrowserAPI
   ,$Init:function ($) {
      TW3CustomBrowserAPI.$Init($);
   }
   /// constructor TW3WebkitBrowserAPI.Create()
   ///  [line: 459, column: 33, file: SmartCL.System]
   ,Create$3:function(Self) {
      Self.FCSSToken = "webkit";
      Self.FCSSBackgroundImage = "background-image";
      Self.FCSSBackgroundSize = "webkitbackgroundSize";
      Self.FCSSBackgroundPos = "webkitbackgroundPosition";
      Self.FCSSBackgroundColor = "webkitbackgroundColor";
      Self.FCSSTransform = "webkitTransform";
      Self.FCSSAnimation = "webkitAnimation";
      return Self
   }
   ,Destroy:TObject.Destroy
};
/// TW3OwnedObject = class (TObject)
///  [line: 40, column: 3, file: SmartCL.System]
var TW3OwnedObject = {
   $ClassName:"TW3OwnedObject",
   $Parent:TObject
   ,$Init:function ($) {
      TObject.$Init($);
      $.FOwner = null;
   }
   /// function TW3OwnedObject.AcceptParent(aObject: TObject) : Boolean
   ///  [line: 718, column: 25, file: SmartCL.System]
   ,AcceptParent:function(Self, aObject) {
      var Result = false;
      Result = true;
      return Result
   }
   /// constructor TW3OwnedObject.Create(AOwner: TObject)
   ///  [line: 707, column: 28, file: SmartCL.System]
   ,Create$4:function(Self, AOwner) {
      TObject.Create(Self);
      if (TW3OwnedObject.AcceptParent$(Self,AOwner)) {
         Self.FOwner = AOwner;
      } else {
         throw EW3Exception.CreateFmt($New(EW3OwnedObject),$R[0],["constructor", TObject.ClassName(Self.ClassType), "Unsuitable owner object-type error"]);
      }
      return Self
   }
   ,Destroy:TObject.Destroy
   ,AcceptParent$:function($){return $.ClassType.AcceptParent.apply($.ClassType, arguments)}
   ,Create$4$:function($){return $.ClassType.Create$4.apply($.ClassType, arguments)}
};
/// TW3OperaBrowserAPI = class (TW3CustomBrowserAPI)
///  [line: 110, column: 3, file: SmartCL.System]
var TW3OperaBrowserAPI = {
   $ClassName:"TW3OperaBrowserAPI",
   $Parent:TW3CustomBrowserAPI
   ,$Init:function ($) {
      TW3CustomBrowserAPI.$Init($);
   }
   /// constructor TW3OperaBrowserAPI.Create()
   ///  [line: 444, column: 32, file: SmartCL.System]
   ,Create$5:function(Self) {
      Self.FCSSToken = "O";
      Self.FCSSBackgroundImage = "OBackgroundImage";
      Self.FCSSBackgroundSize = "OBackgroundSize";
      Self.FCSSBackgroundPos = "OBackgroundPosition";
      Self.FCSSBackgroundColor = "backgroundColor";
      Self.FCSSTransform = "OTransform";
      Self.FCSSAnimation = "OAnimation";
      return Self
   }
   ,Destroy:TObject.Destroy
};
/// TW3IEBrowserAPI = class (TW3CustomBrowserAPI)
///  [line: 115, column: 3, file: SmartCL.System]
var TW3IEBrowserAPI = {
   $ClassName:"TW3IEBrowserAPI",
   $Parent:TW3CustomBrowserAPI
   ,$Init:function ($) {
      TW3CustomBrowserAPI.$Init($);
   }
   /// constructor TW3IEBrowserAPI.Create()
   ///  [line: 429, column: 29, file: SmartCL.System]
   ,Create$6:function(Self) {
      Self.FCSSToken = "ms";
      Self.FCSSBackgroundImage = "msBackgroundImage";
      Self.FCSSBackgroundSize = "msBackgroundSize";
      Self.FCSSBackgroundPos = "msBackgroundPosition";
      Self.FCSSBackgroundColor = "backgroundColor";
      Self.FCSSTransform = "msTransform";
      Self.FCSSAnimation = "msAnimation";
      return Self
   }
   ,Destroy:TObject.Destroy
};
/// TW3FirefoxBrowserAPI = class (TW3CustomBrowserAPI)
///  [line: 105, column: 3, file: SmartCL.System]
var TW3FirefoxBrowserAPI = {
   $ClassName:"TW3FirefoxBrowserAPI",
   $Parent:TW3CustomBrowserAPI
   ,$Init:function ($) {
      TW3CustomBrowserAPI.$Init($);
   }
   /// constructor TW3FirefoxBrowserAPI.Create()
   ///  [line: 474, column: 34, file: SmartCL.System]
   ,Create$7:function(Self) {
      Self.FCSSToken = "Moz";
      Self.FCSSBackgroundImage = "backgroundImage";
      Self.FCSSBackgroundSize = "backgroundSize";
      Self.FCSSBackgroundPos = "backgroundPosition";
      Self.FCSSBackgroundColor = "backgroundColor";
      Self.FCSSTransform = "MozTransform";
      Self.FCSSAnimation = "MozAnimation";
      return Self
   }
   ,Destroy:TObject.Destroy
};
/// TW3BrowserVendor enumeration
///  [line: 244, column: 3, file: SmartCL.System]
var TW3BrowserVendor = [ "bvUnknown", "bviOS", "bvAndroid", "bvChrome", "bvSafari", "bvFirefox", "bvOpera", "bvIE" ];
/// EW3Exception = class (Exception)
///  [line: 31, column: 3, file: SmartCL.System]
var EW3Exception = {
   $ClassName:"EW3Exception",
   $Parent:Exception
   ,$Init:function ($) {
      Exception.$Init($);
   }
   /// constructor EW3Exception.CreateFmt(aText: String; const aValues: array of const)
   ///  [line: 1050, column: 26, file: SmartCL.System]
   ,CreateFmt:function(Self, aText, aValues) {
      Exception.Create(Self,Format(aText,aValues.slice(0)));
      return Self
   }
   ,Destroy:Exception.Destroy
};
/// EW3OwnedObject = class (EW3Exception)
///  [line: 37, column: 3, file: SmartCL.System]
var EW3OwnedObject = {
   $ClassName:"EW3OwnedObject",
   $Parent:EW3Exception
   ,$Init:function ($) {
      EW3Exception.$Init($);
   }
   ,Destroy:Exception.Destroy
};
function BrowserAPI() {
   var Result = null;
   if (vDriver===null) {
      InternalInitVendorInfo();
   }
   Result = vDriver;
   return Result
};
function InternalInitVendorInfo() {
   if (w3_getIsAndroid()) {
      vVendor = 2;
   } else if (w3_getIsSafari()) {
      vVendor = 4;
   } else if (w3_getIsFirefox()) {
      vVendor = 5;
   } else if (w3_getIsChrome()) {
      vVendor = 3;
   } else if (w3_getIsInternetExplorer()) {
      vVendor = 7;
   } else if (w3_getIsOpera()) {
      vVendor = 6;
   }
   if (vVendor==0) {
      if ((w3_getIsIPhone()||w3_getIsIPad())||w3_getIsIPod()) {
         vVendor = 1;
      }
   }
   switch (vVendor) {
      case 1 :
      case 4 :
      case 3 :
      case 2 :
         w3_RegisterBrowserAPI(TW3WebkitBrowserAPI.Create$3($New(TW3WebkitBrowserAPI)));
         break;
      case 5 :
         w3_RegisterBrowserAPI(TW3FirefoxBrowserAPI.Create$7($New(TW3FirefoxBrowserAPI)));
         break;
      case 7 :
         w3_RegisterBrowserAPI(TW3IEBrowserAPI.Create$6($New(TW3IEBrowserAPI)));
         break;
      case 6 :
         w3_RegisterBrowserAPI(TW3OperaBrowserAPI.Create$5($New(TW3OperaBrowserAPI)));
         break;
      default :
         w3_RegisterBrowserAPI(TW3FirefoxBrowserAPI.Create$7($New(TW3FirefoxBrowserAPI)));
   }
};
function InitAnimationFrameShim() {
   
    vRequestAnimFrame = (function(){
      return  window.requestAnimationFrame       ||
              window.webkitRequestAnimationFrame ||
              window.mozRequestAnimationFrame    ||
              window.msRequestAnimationFrame     ||
              function( callback ){
                return window.setTimeout(callback, 1000 / 60);
              };
    })();
    vCancelAnimFrame = (function(){
      return  window.cancelAnimationFrame       ||
              window.webkitCancelAnimationFrame ||
              window.mozCancelAnimationFrame    ||
              window.msCancelAnimationFrame     ||
              function( handle ){
                window.clearTimeout(handle);
              };
    })();
  };
function VarIsValidRef(aRef) {
   var Result = false;
   
    Result = !((aRef == null) || (aRef == undefined));
  return Result
};
/// TVariant = class (TObject)
///  [line: 220, column: 3, file: System.Types]
var TVariant = {
   $ClassName:"TVariant",
   $Parent:TObject
   ,$Init:function ($) {
      TObject.$Init($);
   }
   /// function TVariant.AsFloat(const aValue: Variant) : Float
   ///  [line: 1236, column: 25, file: System.Types]
   ,AsFloat:function(aValue$2) {
      var Result = 0;
      if (VarIsValidRef(aValue$2)) {
         Result = Number(aValue$2);
      }
      return Result
   }
   /// function TVariant.AsInteger(const aValue: Variant) : Integer
   ///  [line: 1224, column: 25, file: System.Types]
   ,AsInteger:function(aValue$3) {
      var Result = 0;
      if (VarIsValidRef(aValue$3)) {
         Result = parseInt(aValue$3,10);
      }
      return Result
   }
   /// function TVariant.AsObject(const aValue: Variant) : TObject
   ///  [line: 1242, column: 25, file: System.Types]
   ,AsObject:function(aValue$4) {
      var Result = null;
      if (VarIsValidRef(aValue$4)) {
         
      Result = aValue$4;
          } else {
         Result = null;
      }
      return Result
   }
   /// function TVariant.AsString(const aValue: Variant) : String
   ///  [line: 1230, column: 25, file: System.Types]
   ,AsString:function(aValue$5) {
      var Result = "";
      if (VarIsValidRef(aValue$5)) {
         Result = ""+aValue$5;
      }
      return Result
   }
   /// function TVariant.IsNull(const aValue: Variant) : Boolean
   ///  [line: 1274, column: 25, file: System.Types]
   ,IsNull:function(aValue$6) {
      var Result = false;
      Result = (aValue$6===null);
      return Result
   }
   /// function TVariant.IsNumber(const aValue: Variant) : Boolean
   ///  [line: 1288, column: 25, file: System.Types]
   ,IsNumber:function(aValue$7) {
      var Result = false;
      
    if (aValue$7 == null) return false;
    if (aValue$7 == undefined) return false;
    if (typeof(aValue$7) === "number") return true;
  return Result
   }
   /// function TVariant.IsString(const aValue: Variant) : Boolean
   ///  [line: 1279, column: 25, file: System.Types]
   ,IsString:function(aValue$8) {
      var Result = false;
      
    if (aValue$8 == null) return false;
    if (aValue$8 == undefined) return false;
    if (typeof(aValue$8) === "string") return true;
  return Result
   }
   ,Destroy:TObject.Destroy
};
/// TRectF = record
///  [line: 155, column: 3, file: System.Types]
function Copy$TRectF(s,d) {
   d.Bottom=s.Bottom;
   d.Left=s.Left;
   d.Right=s.Right;
   d.Top=s.Top;
   return d;
}
function Clone$TRectF($) {
   return {
      Bottom:$.Bottom,
      Left:$.Left,
      Right:$.Right,
      Top:$.Top
   }
}
/// function TRectF.CreateBounded(x1: Float; y1: Float; x2: Float; y2: Float) : TRectF
///  [line: 740, column: 23, file: System.Types]
function CreateBounded(x1, y1, x2, y2) {
   var Result = {Bottom:0,Left:0,Right:0,Top:0};
   if (x1<x2) {
      Result.Left = x1;
      Result.Right = x2;
   } else {
      Result.Left = x2;
      Result.Right = x1;
   }
   if (y1<y2) {
      Result.Top = y1;
      Result.Bottom = y2;
   } else {
      Result.Top = y2;
      Result.Bottom = y1;
   }
   return Result
}
/// function TRectF.Height(var Self: TRectF) : Float
///  [line: 864, column: 17, file: System.Types]
function TRectF$Height(Self$2) {
   var Result = 0;
   Result = Self$2.Bottom-Self$2.Top;
   return Result
}
/// function TRectF.Width(var Self: TRectF) : Float
///  [line: 859, column: 17, file: System.Types]
function TRectF$Width(Self$3) {
   var Result = 0;
   Result = Self$3.Right-Self$3.Left;
   return Result
}
/// TRect = record
///  [line: 119, column: 3, file: System.Types]
function Copy$TRect(s,d) {
   d.Bottom$1=s.Bottom$1;
   d.Left$1=s.Left$1;
   d.Right$1=s.Right$1;
   d.Top$1=s.Top$1;
   return d;
}
function Clone$TRect($) {
   return {
      Bottom$1:$.Bottom$1,
      Left$1:$.Left$1,
      Right$1:$.Right$1,
      Top$1:$.Top$1
   }
}
/// function TRect.ContainsPos(var Self: TRect; const aLeft: Integer; const aTop: Integer) : Boolean
///  [line: 665, column: 16, file: System.Types]
function TRect$ContainsPos$1(Self$4, aLeft, aTop) {
   var Result = false;
   Result = (((aLeft>=Self$4.Left$1)&&(aLeft<=Self$4.Right$1))&&(aTop>=Self$4.Top$1))&&(aTop<=Self$4.Bottom$1);
   return Result
}
/// function TRect.Height(var Self: TRect) : Integer
///  [line: 519, column: 16, file: System.Types]
function TRect$Height$1(Self$5) {
   var Result = 0;
   Result = Self$5.Bottom$1-Self$5.Top$1;
   return Result
}
/// function TRect.Width(var Self: TRect) : Integer
///  [line: 514, column: 16, file: System.Types]
function TRect$Width$1(Self$6) {
   var Result = 0;
   Result = Self$6.Right$1-Self$6.Left$1;
   return Result
}
/// TPointF = record
///  [line: 78, column: 3, file: System.Types]
function Copy$TPointF(s,d) {
   d.X=s.X;
   d.Y=s.Y;
   return d;
}
function Clone$TPointF($) {
   return {
      X:$.X,
      Y:$.Y
   }
}
/// TPoint = record
///  [line: 43, column: 3, file: System.Types]
function Copy$TPoint(s,d) {
   d.X$1=s.X$1;
   d.Y$1=s.Y$1;
   return d;
}
function Clone$TPoint($) {
   return {
      X$1:$.X$1,
      Y$1:$.Y$1
   }
}
/// function TPoint.Create(const aCol: Integer; const aRow: Integer) : TPoint
///  [line: 250, column: 23, file: System.Types]
function Create$13(aCol, aRow) {
   var Result = {X$1:0,Y$1:0};
   Result.X$1 = aCol;
   Result.Y$1 = aRow;
   return Result
}
/// TInteger = class (TObject)
///  [line: 189, column: 3, file: System.Types]
var TInteger = {
   $ClassName:"TInteger",
   $Parent:TObject
   ,$Init:function ($) {
      TObject.$Init($);
   }
   /// function TInteger.Diff(const Primary: Integer; const Secondary: Integer) : Integer
   ///  [line: 1129, column: 25, file: System.Types]
   ,Diff:function(Primary, Secondary) {
      var Result = 0;
      if (Primary!=Secondary) {
         if (Primary>Secondary) {
            Result = Primary-Secondary;
         } else {
            Result = Secondary-Primary;
         }
         if (Result<0) {
            Result = (Result-1)^(-1);
         }
      } else {
         Result = 0;
      }
      return Result
   }
   /// function TInteger.EnsureRange(const aValue: Integer; const aMin: Integer; const aMax: Integer) : Integer
   ///  [line: 1083, column: 25, file: System.Types]
   ,EnsureRange:function(aValue$9, aMin, aMax) {
      var Result = 0;
      Result = ClampInt(aValue$9,aMin,aMax);
      return Result
   }
   /// function TInteger.PercentOfValue(const Value: Integer; const Total: Integer) : Integer
   ///  [line: 1154, column: 25, file: System.Types]
   ,PercentOfValue:function(Value$5, Total$2) {
      var Result = 0;
      if (Value$5<=Total$2) {
         Result = Trunc((Value$5/Total$2)*100);
      } else {
         Result = 0;
      }
      return Result
   }
   /// function TInteger.ToPxStr(const aValue: Integer) : String
   ///  [line: 1061, column: 25, file: System.Types]
   ,ToPxStr:function(aValue$10) {
      var Result = "";
      Result = aValue$10.toString()+"px";
      return Result
   }
   /// function TInteger.WrapRange(const aValue: Integer; const aLowRange: Integer; const aHighRange: Integer) : Integer
   ///  [line: 1097, column: 25, file: System.Types]
   ,WrapRange:function(aValue$11, aLowRange, aHighRange) {
      var Result = 0;
      if (aValue$11>aHighRange) {
         Result = aLowRange+TInteger.Diff(aHighRange,(aValue$11-1));
         if (Result>aHighRange) {
            Result = TInteger.WrapRange(Result,aLowRange,aHighRange);
         }
      } else if (aValue$11<aLowRange) {
         Result = aHighRange-TInteger.Diff(aLowRange,(aValue$11+1));
         if (Result<aLowRange) {
            Result = TInteger.WrapRange(Result,aLowRange,aHighRange);
         }
      } else {
         Result = aValue$11;
      }
      return Result
   }
   ,Destroy:TObject.Destroy
};
/// TExposure enumeration
///  [line: 116, column: 3, file: System.Types]
var TExposure = [ "esVisible", "esPartly", "esNone" ];
function OffsetPoint(a, b$1) {
   var Result = {X$1:0,Y$1:0};
   Result.X$1 = a.X$1+b$1.X$1;
   Result.Y$1 = a.Y$1+b$1.Y$1;
   return Result
};
function OffsetPoint$1(a$40, b$2) {
   var Result = {X$1:0,Y$1:0};
   Result.X$1 = a$40.X$1+b$2;
   Result.Y$1 = a$40.Y$1+b$2;
   return Result
};
function OffsetPoint$2(a$41, b$3) {
   var Result = {X:0,Y:0};
   Result.X = a$41.X+b$3.X;
   Result.Y = a$41.Y+b$3.Y;
   return Result
};
function OffsetPoint$3(a$42, b$4) {
   var Result = {X:0,Y:0};
   Result.X = a$42.X+b$4;
   Result.Y = a$42.Y+b$4;
   return Result
};
function OffsetPoint$4(a$43, b$5) {
   var Result = {X:0,Y:0};
   Result.X = a$43.X+b$5;
   Result.Y = a$43.Y+b$5;
   return Result
};
function MinusPoint(a$44, b$6) {
   var Result = {X$1:0,Y$1:0};
   Result.X$1 = a$44.X$1-b$6.X$1;
   Result.Y$1 = a$44.Y$1-b$6.Y$1;
   return Result
};
function MinusPoint$1(a$45, b$7) {
   var Result = {X$1:0,Y$1:0};
   Result.X$1 = a$45.X$1-b$7;
   Result.Y$1 = a$45.Y$1-b$7;
   return Result
};
function MinusPoint$2(a$46, b$8) {
   var Result = {X:0,Y:0};
   Result.X = a$46.X-b$8.X;
   Result.Y = a$46.Y-b$8.Y;
   return Result
};
function MinusPoint$3(a$47, b$9) {
   var Result = {X:0,Y:0};
   Result.X = a$47.X-b$9;
   Result.Y = a$47.Y-b$9;
   return Result
};
function MinusPoint$4(a$48, b$10) {
   var Result = {X:0,Y:0};
   Result.X = a$48.X-b$10;
   Result.Y = a$48.Y-b$10;
   return Result
};
function ExpandPoint(a$49, b$11) {
   var Result = {X$1:0,Y$1:0};
   Result.X$1 = Math.round(a$49.X$1*b$11.X$1);
   Result.Y$1 = Math.round(a$49.Y$1*b$11.Y$1);
   return Result
};
function ExpandPoint$1(a$50, b$12) {
   var Result = {X$1:0,Y$1:0};
   Result.X$1 = Math.round(a$50.X$1*b$12);
   Result.Y$1 = Math.round(a$50.Y$1*b$12);
   return Result
};
function ExpandPoint$2(a$51, b$13) {
   var Result = {X$1:0,Y$1:0};
   Result.X$1 = Math.round(a$51.X$1*b$13);
   Result.Y$1 = Math.round(a$51.Y$1*b$13);
   return Result
};
function ExpandPoint$3(a$52, b$14) {
   var Result = {X:0,Y:0};
   Result.X = a$52.X*b$14.X;
   Result.Y = a$52.Y*b$14.Y;
   return Result
};
function ExpandPoint$4(a$53, b$15) {
   var Result = {X:0,Y:0};
   Result.X = a$53.X*b$15;
   Result.Y = a$53.Y*b$15;
   return Result
};
function ExpandPoint$5(a$54, b$16) {
   var Result = {X:0,Y:0};
   Result.X = a$54.X*b$16;
   Result.Y = a$54.Y*b$16;
   return Result
};
/// TW3DisplayViewArangeType enumeration
///  [line: 36, column: 3, file: SmartCL.Application]
var TW3DisplayViewArangeType = [ "dvaSizeToView", "dvaVStack", "dvaHStack" ];
/// TW3TagObj = class (TObject)
///  [line: 118, column: 3, file: SmartCL.Components]
var TW3TagObj = {
   $ClassName:"TW3TagObj",
   $Parent:TObject
   ,$Init:function ($) {
      TObject.$Init($);
      $.FHandle = undefined;
      $.FObjReady = false;
      $.FOwner$1 = undefined;
      $.FTagId = "";
      $.FUpdating = 0;
   }
   /// procedure TW3TagObj.AfterUpdate()
   ///  [line: 942, column: 21, file: SmartCL.Components]
   ,AfterUpdate:function(Self) {
   }
   /// procedure TW3TagObj.BeginUpdate()
   ///  [line: 927, column: 21, file: SmartCL.Components]
   ,BeginUpdate:function(Self) {
      ++Self.FUpdating;
   }
   /// constructor TW3TagObj.Create()
   ///  [line: 867, column: 23, file: SmartCL.Components]
   ,Create$17:function(Self) {
      TObject.Create(Self);
      Self.FObjReady = false;
      try {
         Self.FTagId = TW3TagObj.MakeElementTagId$(Self);
         Self.FHandle = TW3TagObj.MakeElementTagObj$(Self);
      } catch ($e) {
         var e$1 = $W($e);
         EW3TagObj.RaiseCntErrMethod("TW3TagObj.Create",Self,e$1.FMessage)      }
      if (TVariant.AsObject(Self.FHandle)!==TVariant.AsObject(document.body)) {
         if (Self.FTagId.length>0) {
            w3_setAttrib(Self.FHandle,"id",Self.FTagId);
         }
      }
      TW3TagObj.StyleTagObject$(Self);
      TW3TagObj.BeginUpdate(Self);
      try {
         TW3TagObj.InitializeObject$(Self);
      } finally {
         TW3TagObj.EndUpdate(Self);
      }
      Self.FObjReady = true;
      return Self
   }
   /// destructor TW3TagObj.Destroy()
   ///  [line: 902, column: 22, file: SmartCL.Components]
   ,Destroy:function(Self) {
      if (Self.FHandle) {
         try {
            TW3TagObj.UnHookEvents(Self);
            TW3TagObj.RemoveFrom(Self);
         } finally {
            TW3TagObj.FinalizeObject$(Self);
            Self.FTagId = "";
            Self.FHandle = null;
         }
      }
      TObject.Destroy(Self);
   }
   /// procedure TW3TagObj.EndUpdate()
   ///  [line: 932, column: 21, file: SmartCL.Components]
   ,EndUpdate:function(Self) {
      if (Self.FUpdating>0) {
         --Self.FUpdating;
         if (Self.FUpdating==0) {
            TW3TagObj.AfterUpdate$(Self);
         }
      }
   }
   /// procedure TW3TagObj.FinalizeObject()
   ///  [line: 1010, column: 21, file: SmartCL.Components]
   ,FinalizeObject:function(Self) {
   }
   /// function TW3TagObj.GetInnerHTML() : String
   ///  [line: 970, column: 20, file: SmartCL.Components]
   ,GetInnerHTML:function(Self) {
      var Result = "";
      if (Self.FHandle) {
         Result = ""+Self.FHandle.innerHTML;
      }
      return Result
   }
   /// function TW3TagObj.GetInnerText() : String
   ///  [line: 982, column: 20, file: SmartCL.Components]
   ,GetInnerText:function(Self) {
      var Result = "";
      if (Self.FHandle) {
         Result = ""+Self.FHandle.innerText;
      }
      return Result
   }
   /// function TW3TagObj.GetUpdating() : Boolean
   ///  [line: 922, column: 20, file: SmartCL.Components]
   ,GetUpdating:function(Self) {
      var Result = false;
      Result = Self.FUpdating>0;
      return Result
   }
   /// procedure TW3TagObj.InitializeObject()
   ///  [line: 1006, column: 21, file: SmartCL.Components]
   ,InitializeObject:function(Self) {
   }
   /// procedure TW3TagObj.InsertInto(const OwnerHandle: THandle)
   ///  [line: 1052, column: 21, file: SmartCL.Components]
   ,InsertInto:function(Self, OwnerHandle) {
      if (!OwnerHandle) {
         EW3TagObj.RaiseCntErrMethod("TW3TagObj.InsertInto",Self,$R[9]);
      }
      if (!Self.FHandle) {
         EW3TagObj.RaiseCntErrMethod("TW3TagObj.InsertInto",Self,$R[2]);
      }
      try {
         if (Self.FOwner$1) {
            TW3TagObj.RemoveFrom(Self);
         }
         w3_setElementParentByRef(Self.FHandle,OwnerHandle);
         Self.FOwner$1 = OwnerHandle;
      } catch ($e) {
         var e$2 = $W($e);
         EW3TagObj.RaiseCntErrMethod("TW3TagObj.InsertInto",Self,e$2.FMessage)      }
   }
   /// function TW3TagObj.MakeElementTagId() : String
   ///  [line: 1036, column: 20, file: SmartCL.Components]
   ,MakeElementTagId:function(Self) {
      var Result = "";
      Result = TObject.ClassName(Self.ClassType)+w3_GetUniqueNumber().toString();
      return Result
   }
   /// function TW3TagObj.MakeElementTagObj() : THandle
   ///  [line: 1042, column: 20, file: SmartCL.Components]
   ,MakeElementTagObj:function(Self) {
      var Result = undefined;
      Result = w3_createHtmlElement("div");
      return Result
   }
   /// procedure TW3TagObj.RemoveFrom()
   ///  [line: 1075, column: 21, file: SmartCL.Components]
   ,RemoveFrom:function(Self) {
      if (!Self.FOwner$1) {
         EW3TagObj.RaiseCntErrMethod("TW3TagObj.RemoveFrom",Self,$R[9]);
      }
      if (!Self.FHandle) {
         EW3TagObj.RaiseCntErrMethod("TW3TagObj.RemoveFrom",Self,$R[2]);
      }
      try {
         w3_RemoveElementByRef(Self.FHandle,Self.FOwner$1);
         Self.FOwner$1 = undefined;
      } catch ($e) {
         var e$3 = $W($e);
         EW3TagObj.RaiseCntErrMethod("TW3TagObj.RemoveFrom",Self,e$3.FMessage)      }
   }
   /// procedure TW3TagObj.SetInnerHTML(aValue: String)
   ///  [line: 976, column: 21, file: SmartCL.Components]
   ,SetInnerHTML:function(Self, aValue$12) {
      if (Self.FHandle) {
         Self.FHandle.innerHTML = aValue$12;
      }
   }
   /// procedure TW3TagObj.SetInnerText(aValue: String)
   ///  [line: 988, column: 21, file: SmartCL.Components]
   ,SetInnerText:function(Self, aValue$13) {
      if (Self.FHandle) {
         Self.FHandle.innerText = aValue$13;
      }
   }
   /// procedure TW3TagObj.StyleTagObject()
   ///  [line: 1014, column: 21, file: SmartCL.Components]
   ,StyleTagObject:function(Self) {
      if (Self.FHandle) {
         Self.FHandle.style["visibility"] = "hidden";
         Self.FHandle.style["display"] = "none";
         Self.FHandle.style["position"] = "absolute";
         Self.FHandle.style["overflow"] = "hidden";
         Self.FHandle.style["left"] = "0px";
         Self.FHandle.style["top"] = "0px";
      }
   }
   /// procedure TW3TagObj.UnHookEvents()
   ///  [line: 946, column: 21, file: SmartCL.Components]
   ,UnHookEvents:function(Self) {
      if (Self.FHandle) {
         Self.FHandle.onresize = null;
         Self.FHandle.onselectstart = null;
         Self.FHandle.onfocus = null;
         Self.FHandle.onblur = null;
         Self.FHandle.onchange = null;
         Self.FHandle.onmousedown = null;
         Self.FHandle.onmouseup = null;
         Self.FHandle.onmousemove = null;
         Self.FHandle.onmouseover = null;
         Self.FHandle.onmouseout = null;
         Self.FHandle.onclick = null;
         Self.FHandle.ondblclick = null;
         Self.FHandle.onkeydown = null;
         Self.FHandle.onkeyup = null;
         Self.FHandle.onkeypress = null;
         Self.FHandle.webkitAnimationStart = null;
         Self.FHandle.webkitAnimationEnd = null;
      }
   }
   ,Destroy$:function($){return $.ClassType.Destroy($)}
   ,AfterUpdate$:function($){return $.ClassType.AfterUpdate($)}
   ,FinalizeObject$:function($){return $.ClassType.FinalizeObject($)}
   ,InitializeObject$:function($){return $.ClassType.InitializeObject($)}
   ,MakeElementTagId$:function($){return $.ClassType.MakeElementTagId($)}
   ,MakeElementTagObj$:function($){return $.ClassType.MakeElementTagObj($)}
   ,StyleTagObject$:function($){return $.ClassType.StyleTagObject($)}
};
/// TW3Component = class (TW3TagObj)
///  [line: 166, column: 3, file: SmartCL.Components]
var TW3Component = {
   $ClassName:"TW3Component",
   $Parent:TW3TagObj
   ,$Init:function ($) {
      TW3TagObj.$Init($);
      $.FChildren = [];
      $.FName = "";
      $.FParent = null;
   }
   /// procedure TW3Component.CBNoBehavior()
   ///  [line: 1113, column: 24, file: SmartCL.Components]
   ,CBNoBehavior:function(Self) {
      if (event) {
         event.preventDefault();
      }
   }
   /// procedure TW3Component.ChildAdded(aChild: TW3Component)
   ///  [line: 1221, column: 24, file: SmartCL.Components]
   ,ChildAdded:function(Self, aChild) {
   }
   /// function TW3Component.ChildByName(const compName: String) : TW3Component
   ///  [line: 1119, column: 23, file: SmartCL.Components]
   ,ChildByName:function(Self, compName) {
      var Result = null;
      var lcName = "";
      var i = 0;
      lcName = (Trim$_String_(compName)).toLowerCase();
      var $temp1;
      for(i = 0,$temp1 = TW3Component.GetChildCount(Self);i<$temp1;i++) {
         Result = TW3Component.GetChildObject(Self,i);
         if ((Result.FName).toLowerCase()==lcName) {
            return Result;
         }
      }
      Result = null;
      return Result
   }
   /// procedure TW3Component.ChildRemoved(aChild: TW3Component)
   ///  [line: 1225, column: 24, file: SmartCL.Components]
   ,ChildRemoved:function(Self, aChild$1) {
   }
   /// constructor TW3Component.Create(AOwner: TW3Component)
   ///  [line: 1099, column: 26, file: SmartCL.Components]
   ,Create$18:function(Self, AOwner$1) {
      Self.FParent = AOwner$1;
      TW3TagObj.Create$17(Self);
      if (Self.FParent!==null) {
         TW3Component.RegisterChild(Self.FParent,Self);
      }
      return Self
   }
   /// procedure TW3Component.FinalizeObject()
   ///  [line: 1165, column: 24, file: SmartCL.Components]
   ,FinalizeObject:function(Self) {
      TW3Component.FreeChildren(Self);
      if (Self.FParent!==null) {
         TW3Component.UnRegisterChild(Self.FParent,Self);
      }
      Self.FChildren.length=0;
      TW3TagObj.FinalizeObject(Self);
   }
   /// procedure TW3Component.FreeChildren()
   ///  [line: 1195, column: 24, file: SmartCL.Components]
   ,FreeChildren:function(Self) {
      var oldCount = 0;
      try {
         while (Self.FChildren.length>0) {
            oldCount = Self.FChildren.length;
            TObject.Free(Self.FChildren[0]);
            if (oldCount==Self.FChildren.length) {
               Self.FChildren.shift();
            }
         }
      } finally {
         Self.FChildren.length=0;
      }
   }
   /// function TW3Component.GetChildCount() : Integer
   ///  [line: 1180, column: 23, file: SmartCL.Components]
   ,GetChildCount:function(Self) {
      var Result = 0;
      Result = Self.FChildren.length;
      return Result
   }
   /// function TW3Component.GetChildObject(index: Integer) : TW3Component
   ///  [line: 1185, column: 23, file: SmartCL.Components]
   ,GetChildObject:function(Self, index) {
      var Result = null;
      Result = Self.FChildren[index];
      return Result
   }
   /// procedure TW3Component.InitializeObject()
   ///  [line: 1160, column: 24, file: SmartCL.Components]
   ,InitializeObject:function(Self) {
      TW3TagObj.InitializeObject(Self);
   }
   /// procedure TW3Component.RegisterChild(aChild: TW3Component)
   ///  [line: 1229, column: 24, file: SmartCL.Components]
   ,RegisterChild:function(Self, aChild$2) {
      if ((aChild$2!==null)&&(Self.FChildren.indexOf(aChild$2)<0)) {
         Self.FChildren.push(aChild$2);
         TW3TagObj.InsertInto(aChild$2,Self.FHandle);
         TW3Component.ChildAdded$(Self,aChild$2);
      }
   }
   /// procedure TW3Component.SetName(Value: String)
   ///  [line: 1190, column: 24, file: SmartCL.Components]
   ,SetName:function(Self, Value$6) {
      Self.FName = Value$6;
   }
   /// procedure TW3Component.UnRegisterChild(aChild: TW3Component)
   ///  [line: 1239, column: 24, file: SmartCL.Components]
   ,UnRegisterChild:function(Self, aChild$3) {
      var mIndex = 0;
      if (aChild$3!==null) {
         mIndex = Self.FChildren.indexOf(aChild$3);
         if (mIndex>=0) {
            Self.FChildren.splice(mIndex,1)
            ;
            TW3Component.ChildRemoved(Self,aChild$3);
         }
         TW3TagObj.RemoveFrom(aChild$3);
      }
   }
   ,Destroy:TW3TagObj.Destroy
   ,AfterUpdate:TW3TagObj.AfterUpdate
   ,FinalizeObject$:function($){return $.ClassType.FinalizeObject($)}
   ,InitializeObject$:function($){return $.ClassType.InitializeObject($)}
   ,MakeElementTagId:TW3TagObj.MakeElementTagId
   ,MakeElementTagObj:TW3TagObj.MakeElementTagObj
   ,StyleTagObject:TW3TagObj.StyleTagObject
   ,ChildAdded$:function($){return $.ClassType.ChildAdded.apply($.ClassType, arguments)}
   ,Create$18$:function($){return $.ClassType.Create$18.apply($.ClassType, arguments)}
};
/// TW3MovableControl = class (TW3Component)
///  [line: 296, column: 3, file: SmartCL.Components]
var TW3MovableControl = {
   $ClassName:"TW3MovableControl",
   $Parent:TW3Component
   ,$Init:function ($) {
      TW3Component.$Init($);
      $.FAdjusted = $.FTransparent = $.FUseAlpha = $.FWasMoved = $.FWasSized = false;
      $.FAlpha = 0;
      $.FBackground = $.FBorders = $.FConstraints = null;
      $.FColor = 0;
   }
   /// procedure TW3MovableControl.AdjustToParentBox()
   ///  [line: 1598, column: 29, file: SmartCL.Components]
   ,AdjustToParentBox:function(Self) {
      var x$1 = 0;
      var dx = 0;
      var dy = 0;
      var mChild = null;
      var mCtrl = null;
      if (Self.FHandle) {
         if (!Self.FAdjusted) {
            Self.FAdjusted = true;
            dx = TW3Borders.GetHSpace(TW3MovableControl.GetBorder(Self));
            dy = TW3Borders.GetVSpace(TW3MovableControl.GetBorder(Self));
            var $temp2;
            for(x$1 = 0,$temp2 = TW3Component.GetChildCount(Self);x$1<$temp2;x$1++) {
               mChild = TW3Component.GetChildObject(Self,x$1);
               if ($Is(mChild,TW3MovableControl)) {
                  mCtrl = $As(mChild,TW3MovableControl);
                  if (TW3MovableControl.supportAdjustment$(mCtrl.ClassType)) {
                     if ((dx>0)||(dy>0)) {
                        TW3MovableControl.SetSize(mCtrl,TW3MovableControl.GetWidth$(mCtrl)-dx,TW3MovableControl.GetHeight$(mCtrl)-dy);
                     }
                     setTimeout($Event0(mCtrl,TW3MovableControl.AdjustToParentBox),1);
                  }
               }
            }
         }
      }
   }
   /// procedure TW3MovableControl.AfterUpdate()
   ///  [line: 1727, column: 29, file: SmartCL.Components]
   ,AfterUpdate:function(Self) {
      Self.FWasMoved = false;
      Self.FWasSized = false;
   }
   /// function TW3MovableControl.ClientHeight() : Integer
   ///  [line: 1643, column: 28, file: SmartCL.Components]
   ,ClientHeight:function(Self) {
      var Result = 0;
      if (Self.FHandle) {
         if (VarIsValidRef(Self.FHandle.clientHeight)) {
            Result = TVariant.AsInteger(Self.FHandle.clientHeight);
            if (isNaN(Result)||(Result==0)) {
               Result = TW3MovableControl.GetWidth$(Self);
            }
         } else {
            Result = TW3MovableControl.GetWidth$(Self);
         }
      }
      return Result
   }
   /// function TW3MovableControl.ClientWidth() : Integer
   ///  [line: 1630, column: 28, file: SmartCL.Components]
   ,ClientWidth:function(Self) {
      var Result = 0;
      if (Self.FHandle) {
         if (VarIsValidRef(Self.FHandle.clientWidth)) {
            Result = TVariant.AsInteger(Self.FHandle.clientWidth);
            if (isNaN(Result)||(Result==0)) {
               Result = TW3MovableControl.GetWidth$(Self);
            }
         } else {
            Result = TW3MovableControl.GetWidth$(Self);
         }
      }
      return Result
   }
   /// function TW3MovableControl.DisplayMode() : String
   ///  [line: 1748, column: 34, file: SmartCL.Components]
   ,DisplayMode:function(Self) {
      var Result = "";
      Result = "inline-block";
      return Result
   }
   /// procedure TW3MovableControl.FinalizeObject()
   ///  [line: 1699, column: 29, file: SmartCL.Components]
   ,FinalizeObject:function(Self) {
      if (Self.FBackground) {
         TObject.Free(Self.FBackground);
      }
      if (Self.FBorders) {
         TObject.Free(Self.FBorders);
      }
      if (Self.FConstraints) {
         TObject.Free(Self.FConstraints);
      }
      TW3Component.FinalizeObject(Self);
   }
   /// function TW3MovableControl.GetBorder() : TW3Borders
   ///  [line: 1720, column: 28, file: SmartCL.Components]
   ,GetBorder:function(Self) {
      var Result = null;
      if (Self.FBorders===null) {
         Self.FBorders = TW3OwnedObject.Create$4$($New(TW3Borders),Self);
      }
      Result = Self.FBorders;
      return Result
   }
   /// function TW3MovableControl.GetBoundsRect() : TRect
   ///  [line: 1771, column: 28, file: SmartCL.Components]
   ,GetBoundsRect:function(Self) {
      var Result = {Bottom$1:0,Left$1:0,Right$1:0,Top$1:0};
      Result.Left$1 = TW3MovableControl.GetLeft(Self);
      Result.Top$1 = TW3MovableControl.GetTop(Self);
      Result.Right$1 = Result.Left$1+TW3MovableControl.GetWidth$(Self);
      Result.Bottom$1 = Result.Top$1+TW3MovableControl.GetHeight$(Self);
      return Result
   }
   /// function TW3MovableControl.GetHeight() : Integer
   ///  [line: 1823, column: 28, file: SmartCL.Components]
   ,GetHeight:function(Self) {
      var Result = 0;
      if (Self.FHandle) {
         Result = parseInt(Self.FHandle.offsetHeight,10);
      }
      return Result
   }
   /// function TW3MovableControl.GetLeft() : Integer
   ///  [line: 1779, column: 28, file: SmartCL.Components]
   ,GetLeft:function(Self) {
      var Result = 0;
      Result = w3_getStyleAsInt(Self.FHandle,"left");
      return Result
   }
   /// function TW3MovableControl.GetTop() : Integer
   ///  [line: 1792, column: 28, file: SmartCL.Components]
   ,GetTop:function(Self) {
      var Result = 0;
      Result = w3_getStyleAsInt(Self.FHandle,"top");
      return Result
   }
   /// function TW3MovableControl.GetVisible() : Boolean
   ///  [line: 1740, column: 28, file: SmartCL.Components]
   ,GetVisible:function(Self) {
      var Result = false;
      var mValue$2 = "";
      mValue$2 = w3_getStyleAsStr(Self.FHandle,"visibility");
      Result = (mValue$2).toLowerCase()=="visible";
      return Result
   }
   /// function TW3MovableControl.GetWasMoved() : Boolean
   ///  [line: 1841, column: 28, file: SmartCL.Components]
   ,GetWasMoved:function(Self) {
      var Result = false;
      Result = Self.FWasMoved;
      return Result
   }
   /// function TW3MovableControl.GetWasSized() : Boolean
   ///  [line: 1846, column: 28, file: SmartCL.Components]
   ,GetWasSized:function(Self) {
      var Result = false;
      Result = Self.FWasSized;
      return Result
   }
   /// function TW3MovableControl.GetWidth() : Integer
   ///  [line: 1805, column: 28, file: SmartCL.Components]
   ,GetWidth:function(Self) {
      var Result = 0;
      if (Self.FHandle) {
         Result = parseInt(Self.FHandle.offsetWidth,10);
      }
      return Result
   }
   /// procedure TW3MovableControl.InitializeObject()
   ///  [line: 1528, column: 29, file: SmartCL.Components]
   ,InitializeObject:function(Self) {
      TW3Component.InitializeObject(Self);
      Self.FAlpha = 255;
      Self.FColor = 536870911;
      Self.FTransparent = false;
   }
   /// procedure TW3MovableControl.MoveTo(aLeft: Integer; aTop: Integer)
   ///  [line: 1869, column: 29, file: SmartCL.Components]
   ,MoveTo:function(Self, aLeft$1, aTop$1) {
      TW3TagObj.BeginUpdate(Self);
      Self.FHandle.style["left"] = TInteger.ToPxStr(aLeft$1);
      Self.FHandle.style["top"] = TInteger.ToPxStr(aTop$1);
      TW3MovableControl.SetWasMoved(Self);
      TW3TagObj.EndUpdate(Self);
   }
   /// procedure TW3MovableControl.Resize()
   ///  [line: 1865, column: 29, file: SmartCL.Components]
   ,Resize:function(Self) {
   }
   /// function TW3MovableControl.ScreenRect() : TRect
   ///  [line: 1662, column: 28, file: SmartCL.Components]
   ,ScreenRect:function(Self) {
      var Result = {Bottom$1:0,Left$1:0,Right$1:0,Top$1:0};
      var elem = undefined;
      if (Self.FHandle) {
         elem = Self.FHandle;
         while (true) {
            Result.Left$1+=parseInt(elem.offsetLeft,10);
            Result.Top$1+=parseInt(elem.offsetTop,10);
            elem = elem.offsetParent;
            if (elem) {
               Result.Left$1-=parseInt(elem.scrollLeft,10);
               Result.Top$1-=parseInt(elem.scrollTop,10);
            } else {
               break;
            }
         }
         Result.Right$1 = parseInt((Result.Left$1+Self.FHandle.offsetWidth),10);
         Result.Bottom$1 = parseInt((Result.Top$1+Self.FHandle.offsetHeight),10);
      }
      return Result
   }
   /// procedure TW3MovableControl.SetAlpha(const aValue: Integer)
   ///  [line: 1935, column: 29, file: SmartCL.Components]
   ,SetAlpha:function(Self, aValue$14) {
      Self.FAlpha = ClampInt(aValue$14,0,255);
      if (Self.FUseAlpha) {
         Self.FHandle.style["opacity"] = Self.FAlpha*0.01;
      }
   }
   /// procedure TW3MovableControl.SetBounds(aLeft: Integer; aTop: Integer; aWidth: Integer; aHeight: Integer)
   ///  [line: 1878, column: 29, file: SmartCL.Components]
   ,SetBounds$2:function(Self, aLeft$2, aTop$2, aWidth, aHeight) {
      var mSized = false;
      var mMoved = false;
      aWidth = Math.max(0,aWidth);
      aHeight = Math.max(0,aHeight);
      mMoved = (aLeft$2!=TW3MovableControl.GetLeft(Self))||(aTop$2!=TW3MovableControl.GetTop(Self));
      mSized = (aWidth!=TW3MovableControl.GetWidth$(Self))||(aHeight!=TW3MovableControl.GetHeight$(Self));
      TW3TagObj.BeginUpdate(Self);
      Self.FHandle.style["left"] = TInteger.ToPxStr(aLeft$2);
      Self.FHandle.style["top"] = TInteger.ToPxStr(aTop$2);
      Self.FHandle.style["width"] = TInteger.ToPxStr(aWidth);
      Self.FHandle.style["height"] = TInteger.ToPxStr(aHeight);
      if (mMoved) {
         TW3MovableControl.SetWasMoved(Self);
      }
      if (mSized) {
         TW3MovableControl.SetWasSized(Self);
      }
      TW3TagObj.EndUpdate(Self);
   }
   /// procedure TW3MovableControl.SetColor(const aValue: TColor)
   ///  [line: 1960, column: 29, file: SmartCL.Components]
   ,SetColor:function(Self, aValue$15) {
      var mText = "";
      if (aValue$15!=Self.FColor) {
         Self.FColor = aValue$15;
         mText = ColorToWebStr(Self.FColor,(Self.FTransparent)?0:255);
         Self.FHandle.style["backgroundColor"] = mText;
      }
   }
   /// procedure TW3MovableControl.SetHeight(aValue: Integer)
   ///  [line: 1829, column: 29, file: SmartCL.Components]
   ,SetHeight:function(Self, aValue$16) {
      aValue$16 = Math.max(aValue$16,0);
      if (aValue$16!=TW3MovableControl.GetHeight$(Self)) {
         TW3TagObj.BeginUpdate(Self);
         Self.FHandle.style["height"] = TInteger.ToPxStr(aValue$16);
         TW3MovableControl.SetWasSized(Self);
         TW3TagObj.EndUpdate(Self);
      }
   }
   /// procedure TW3MovableControl.SetLeft(const aValue: Integer)
   ///  [line: 1784, column: 29, file: SmartCL.Components]
   ,SetLeft:function(Self, aValue$17) {
      TW3TagObj.BeginUpdate(Self);
      Self.FHandle.style["left"] = TInteger.ToPxStr(aValue$17);
      TW3MovableControl.SetWasMoved(Self);
      TW3TagObj.EndUpdate(Self);
   }
   /// procedure TW3MovableControl.SetSize(aWidth: Integer; aHeight: Integer)
   ///  [line: 1907, column: 29, file: SmartCL.Components]
   ,SetSize:function(Self, aWidth$1, aHeight$1) {
      aWidth$1 = Math.max(aWidth$1,0);
      aHeight$1 = Math.max(aHeight$1,0);
      if ((aWidth$1!=TW3MovableControl.GetWidth$(Self))||(aHeight$1!=TW3MovableControl.GetHeight$(Self))) {
         TW3TagObj.BeginUpdate(Self);
         Self.FHandle.style["width"] = TInteger.ToPxStr(aWidth$1);
         Self.FHandle.style["height"] = TInteger.ToPxStr(aHeight$1);
         TW3MovableControl.SetWasSized(Self);
         TW3TagObj.EndUpdate(Self);
      }
   }
   /// procedure TW3MovableControl.SetTop(const aValue: Integer)
   ///  [line: 1797, column: 29, file: SmartCL.Components]
   ,SetTop:function(Self, aValue$18) {
      TW3TagObj.BeginUpdate(Self);
      Self.FHandle.style["top"] = TInteger.ToPxStr(aValue$18);
      TW3MovableControl.SetWasMoved(Self);
      TW3TagObj.EndUpdate(Self);
   }
   /// procedure TW3MovableControl.SetTransparent(const aValue: Boolean)
   ///  [line: 1945, column: 29, file: SmartCL.Components]
   ,SetTransparent:function(Self, aValue$19) {
      var mText$1 = "";
      if (aValue$19!=Self.FTransparent) {
         TW3TagObj.BeginUpdate(Self);
         Self.FTransparent = aValue$19;
         mText$1 = ColorToWebStr(Self.FColor,(aValue$19)?0:255);
         Self.FHandle.style["backgroundColor"] = mText$1;
         TW3MovableControl.SetWasMoved(Self);
         TW3TagObj.EndUpdate(Self);
      }
   }
   /// procedure TW3MovableControl.SetUseAlpha(const aValue: Boolean)
   ///  [line: 1921, column: 29, file: SmartCL.Components]
   ,SetUseAlpha:function(Self, aValue$20) {
      var mBlend = 0;
      if (aValue$20==Self.FUseAlpha) {
         return;
      }
      Self.FUseAlpha = aValue$20;
      if (aValue$20) {
         mBlend = Self.FAlpha*0.01;
      } else {
         mBlend = 1;
      }
      Self.FHandle.style["opacity"] = mBlend;
   }
   /// procedure TW3MovableControl.SetVisible(const aValue: Boolean)
   ///  [line: 1753, column: 29, file: SmartCL.Components]
   ,SetVisible:function(Self, aValue$21) {
      TW3TagObj.BeginUpdate(Self);
      if (aValue$21) {
         Self.FHandle.style["display"] = TW3MovableControl.DisplayMode(Self.ClassType);
         Self.FHandle.style["visibility"] = "visible";
         TW3MovableControl.SetWasSized(Self);
      } else {
         Self.FHandle.style["display"] = "none";
         Self.FHandle.style["visibility"] = "hidden";
      }
      TW3TagObj.EndUpdate(Self);
   }
   /// procedure TW3MovableControl.SetWasMoved()
   ///  [line: 1851, column: 29, file: SmartCL.Components]
   ,SetWasMoved:function(Self) {
      Self.FWasMoved = true;
   }
   /// procedure TW3MovableControl.SetWasSized()
   ///  [line: 1856, column: 29, file: SmartCL.Components]
   ,SetWasSized:function(Self) {
      Self.FWasSized = true;
   }
   /// procedure TW3MovableControl.SetWidth(aValue: Integer)
   ///  [line: 1811, column: 29, file: SmartCL.Components]
   ,SetWidth:function(Self, aValue$22) {
      aValue$22 = Math.max(aValue$22,0);
      if (aValue$22!=TW3MovableControl.GetWidth$(Self)) {
         TW3TagObj.BeginUpdate(Self);
         Self.FHandle.style["width"] = TInteger.ToPxStr(aValue$22);
         TW3MovableControl.SetWasSized(Self);
         TW3TagObj.EndUpdate(Self);
      }
   }
   /// function TW3MovableControl.supportAdjustment() : Boolean
   ///  [line: 1593, column: 34, file: SmartCL.Components]
   ,supportAdjustment:function(Self) {
      var Result = false;
      Result = true;
      return Result
   }
   ,Destroy:TW3TagObj.Destroy
   ,AfterUpdate$:function($){return $.ClassType.AfterUpdate($)}
   ,FinalizeObject$:function($){return $.ClassType.FinalizeObject($)}
   ,InitializeObject$:function($){return $.ClassType.InitializeObject($)}
   ,MakeElementTagId:TW3TagObj.MakeElementTagId
   ,MakeElementTagObj:TW3TagObj.MakeElementTagObj
   ,StyleTagObject:TW3TagObj.StyleTagObject
   ,ChildAdded:TW3Component.ChildAdded
   ,Create$18:TW3Component.Create$18
   ,GetHeight$:function($){return $.ClassType.GetHeight($)}
   ,GetWidth$:function($){return $.ClassType.GetWidth($)}
   ,Resize$:function($){return $.ClassType.Resize($)}
   ,SetHeight$:function($){return $.ClassType.SetHeight.apply($.ClassType, arguments)}
   ,SetWidth$:function($){return $.ClassType.SetWidth.apply($.ClassType, arguments)}
   ,supportAdjustment$:function($){return $.supportAdjustment($)}
};
/// TW3CustomControl = class (TW3MovableControl)
///  [line: 376, column: 3, file: SmartCL.Components]
var TW3CustomControl = {
   $ClassName:"TW3CustomControl",
   $Parent:TW3MovableControl
   ,$Init:function ($) {
      TW3MovableControl.$Init($);
      $.FAngle = 0;
      $.FClassNames = $.FFont = $.FGestureData = $.FNoBehavior = $.FOnAnimationBegins = $.FOnAnimationEnds = $.FOnChanged = $.FOnClick = $.FOnContextPopup = $.FOnDblClick = $.FOnGestureChange = $.FOnGestureEnd = $.FOnGestureStart = $.FOnGotFocus = $.FOnKeyDown = $.FOnKeyPress = $.FOnKeyUp = $.FOnLostFocus = $.FOnMouseDown = $.FOnMouseEnter = $.FOnMouseExit = $.FOnMouseMove = $.FOnMouseUp = $.FOnMouseWheel = $.FOnResize = $.FOnTouchBegins = $.FOnTouchEnds = $.FOnTouchMoves = $.FScrollInfo = $.FTouchData = null;
      $.FMouseCaptured = 0;
      $.FTouchBound = false;
   }
   /// anonymous TSourceMethodSymbol
   ///  [line: 31, column: 43, file: SmartCL.MouseCapture]
   ,a$2:function(Self) {
      return vCaptureControl===Self;
   }
   /// procedure TW3CustomControl.AfterUpdate()
   ///  [line: 2784, column: 28, file: SmartCL.Components]
   ,AfterUpdate:function(Self) {
      if (TW3MovableControl.GetWasSized(Self)) {
         if (Self.FObjReady) {
            TW3MovableControl.Resize$(Self);
         }
         if (!TW3MovableControl.GetWasMoved(Self)) {
            TW3MovableControl.SetWasMoved(Self);
         }
      }
      if (TW3MovableControl.GetWasMoved(Self)) {
         TW3CustomControl.Invalidate$(Self);
      }
      TW3MovableControl.AfterUpdate(Self);
   }
   /// procedure TW3CustomControl.BindTouch()
   ///  [line: 2545, column: 28, file: SmartCL.Components]
   ,BindTouch:function(Self) {
      if (Self.FTouchBound) {
         return;
      }
      Self.FTouchBound = true;
      Self.FHandle.addEventListener("touchstart",$Event1(Self,TW3CustomControl.CMTouchBegins));
      Self.FHandle.addEventListener("touchmove",$Event1(Self,TW3CustomControl.CMTouchMove));
      Self.FHandle.addEventListener("touchend",$Event1(Self,TW3CustomControl.CMTouchEnds));
   }
   /// procedure TW3CustomControl.BringToFront()
   ///  [line: 2164, column: 28, file: SmartCL.Components]
   ,BringToFront:function(Self) {
      if (Self.FHandle) {
         Self.FHandle.style.zIndex = (TW3CustomControl.GetMaxZIndex($As(Self.FParent,TW3CustomControl))+1);
      }
   }
   /// procedure TW3CustomControl.CBAnimationBegins(const eventObj: Variant)
   ///  [line: 2509, column: 28, file: SmartCL.Components]
   ,CBAnimationBegins:function(Self, eventObj) {
      if (Self.FOnAnimationBegins) {
         Self.FOnAnimationBegins(Self);
      }
   }
   /// procedure TW3CustomControl.CBAnimationEnds(const eventObj: Variant)
   ///  [line: 2524, column: 28, file: SmartCL.Components]
   ,CBAnimationEnds:function(Self, eventObj$1) {
      if (Self.FOnAnimationEnds) {
         Self.FOnAnimationEnds(Self);
      }
   }
   /// procedure TW3CustomControl.CBChanged(eventObj: JEvent)
   ///  [line: 2539, column: 28, file: SmartCL.Components]
   ,CBChanged:function(Self, eventObj$2) {
      if (Self.FOnChanged) {
         Self.FOnChanged(Self);
      }
   }
   /// procedure TW3CustomControl.CBClick(eventObj: JEvent)
   ///  [line: 2430, column: 28, file: SmartCL.Components]
   ,CBClick:function(Self, eventObj$3) {
      if (Self.FOnClick) {
         Self.FOnClick(Self);
      }
   }
   /// function TW3CustomControl.CBContextPopup(event: JMouseEvent) : Boolean
   ///  [line: 2717, column: 27, file: SmartCL.Components]
   ,CBContextPopup:function(Self, event) {
      var Result = false;
      var sr = {Bottom$1:0,Left$1:0,Right$1:0,Top$1:0};
      var mp = {X$1:0,Y$1:0};
      var handled = {v:false};
      sr = TW3MovableControl.ScreenRect(Self);
      mp.X$1 = event.clientX-sr.Left$1;
      mp.Y$1 = event.clientY-sr.Top$1;
      handled.v = false;
      TW3CustomControl.ContextPopup(Self,mp,handled);
      Result = !handled.v;
      return Result
   }
   /// procedure TW3CustomControl.CBDblClick(eventObj: JEvent)
   ///  [line: 2450, column: 28, file: SmartCL.Components]
   ,CBDblClick:function(Self, eventObj$4) {
      if (Self.FOnDblClick) {
         Self.FOnDblClick(Self);
      }
   }
   /// procedure TW3CustomControl.CBFocused()
   ///  [line: 2079, column: 28, file: SmartCL.Components]
   ,CBFocused:function(Self) {
      if (Self.FOnGotFocus) {
         Self.FOnGotFocus(Self);
      }
   }
   /// procedure TW3CustomControl.CBKeyDown(eventObj: JKeyboardEvent)
   ///  [line: 2467, column: 28, file: SmartCL.Components]
   ,CBKeyDown:function(Self, eventObj$5) {
      if (Self.FOnKeyDown) {
         Self.FOnKeyDown(Self,eventObj$5.keyCode);
      }
   }
   /// procedure TW3CustomControl.CBKeyPress(eventObj: JKeyboardEvent)
   ///  [line: 2494, column: 28, file: SmartCL.Components]
   ,CBKeyPress:function(Self, eventObj$6) {
      if (Self.FOnKeyPress) {
         Self.FOnKeyPress(Self,eventObj$6.charCode);
      }
   }
   /// procedure TW3CustomControl.CBKeyUp(eventObj: JKeyboardEvent)
   ///  [line: 2479, column: 28, file: SmartCL.Components]
   ,CBKeyUp:function(Self, eventObj$7) {
      if (Self.FOnKeyUp) {
         Self.FOnKeyUp(Self,eventObj$7.keyCode);
      }
   }
   /// procedure TW3CustomControl.CBLostFocus()
   ///  [line: 2085, column: 28, file: SmartCL.Components]
   ,CBLostFocus:function(Self) {
      if (Self.FOnLostFocus) {
         Self.FOnLostFocus(Self);
      }
   }
   /// procedure TW3CustomControl.CBMouseDown(eventObj: JMouseEvent)
   ///  [line: 2268, column: 28, file: SmartCL.Components]
   ,CBMouseDown:function(Self, eventObj$8) {
      var sr$1 = {Bottom$1:0,Left$1:0,Right$1:0,Top$1:0};
      var shiftState = null;
      sr$1 = TW3MovableControl.ScreenRect(Self);
      shiftState = TShiftState.Current();
      shiftState.FMouseButtons = shiftState.FMouseButtons|(1<<eventObj$8.button);
      TShiftState.SetMouseEvent(shiftState,eventObj$8);
      TW3CustomControl.MouseDown(Self,eventObj$8.button,shiftState,eventObj$8.clientX-sr$1.Left$1,eventObj$8.clientY-sr$1.Top$1);
   }
   /// procedure TW3CustomControl.CBMouseEnter(eventObj: JMouseEvent)
   ///  [line: 2335, column: 28, file: SmartCL.Components]
   ,CBMouseEnter:function(Self, eventObj$9) {
      var sr$2 = {Bottom$1:0,Left$1:0,Right$1:0,Top$1:0};
      var shiftState$1 = null;
      sr$2 = TW3MovableControl.ScreenRect(Self);
      shiftState$1 = TShiftState.Current();
      TShiftState.SetMouseEvent(shiftState$1,eventObj$9);
      TW3CustomControl.MouseEnter(Self,shiftState$1,eventObj$9.clientX-sr$2.Left$1,eventObj$9.clientY-sr$2.Top$1);
   }
   /// procedure TW3CustomControl.CBMouseExit(eventObj: JMouseEvent)
   ///  [line: 2359, column: 28, file: SmartCL.Components]
   ,CBMouseExit:function(Self, eventObj$10) {
      var sr$3 = {Bottom$1:0,Left$1:0,Right$1:0,Top$1:0};
      var shiftState$2 = null;
      sr$3 = TW3MovableControl.ScreenRect(Self);
      shiftState$2 = TShiftState.Current();
      TShiftState.SetMouseEvent(shiftState$2,eventObj$10);
      TW3CustomControl.MouseExit(Self,shiftState$2,eventObj$10.clientX-sr$3.Left$1,eventObj$10.clientY-sr$3.Top$1);
   }
   /// procedure TW3CustomControl.CBMouseMove(eventObj: JMouseEvent)
   ///  [line: 2313, column: 28, file: SmartCL.Components]
   ,CBMouseMove:function(Self, eventObj$11) {
      var sr$4 = {Bottom$1:0,Left$1:0,Right$1:0,Top$1:0};
      var shiftState$3 = null;
      sr$4 = TW3MovableControl.ScreenRect(Self);
      shiftState$3 = TShiftState.Current();
      TShiftState.SetMouseEvent(shiftState$3,eventObj$11);
      TW3CustomControl.MouseMove(Self,shiftState$3,eventObj$11.clientX-sr$4.Left$1,eventObj$11.clientY-sr$4.Top$1);
   }
   /// procedure TW3CustomControl.CBMouseUp(eventObj: JMouseEvent)
   ///  [line: 2291, column: 28, file: SmartCL.Components]
   ,CBMouseUp:function(Self, eventObj$12) {
      var sr$5 = {Bottom$1:0,Left$1:0,Right$1:0,Top$1:0};
      var shiftState$4 = null;
      sr$5 = TW3MovableControl.ScreenRect(Self);
      shiftState$4 = TShiftState.Current();
      shiftState$4.FMouseButtons = shiftState$4.FMouseButtons&(~(1<<eventObj$12.button));
      TShiftState.SetMouseEvent(shiftState$4,eventObj$12);
      TW3CustomControl.MouseUp(Self,eventObj$12.button,shiftState$4,eventObj$12.clientX-sr$5.Left$1,eventObj$12.clientY-sr$5.Top$1);
   }
   /// procedure TW3CustomControl.CBMouseWheel(eventObj: JMouseWheelEvent)
   ///  [line: 2394, column: 28, file: SmartCL.Components]
   ,CBMouseWheel:function(Self, eventObj$13) {
      var wheelDelta$1 = 0;
      var handled$1 = {};
      handled$1.v = false;
      var sr$6 = {Bottom$1:0,Left$1:0,Right$1:0,Top$1:0};
      var shiftState$5 = null;
      var mousePos = {X$1:0,Y$1:0};
      if (Self.FOnMouseWheel) {
         if (eventObj$13.detail) {
            wheelDelta$1 = eventObj$13.detail*-40;
         } else {
            wheelDelta$1 = eventObj$13.wheelDelta;
         }
         sr$6 = TW3MovableControl.ScreenRect(Self);
         shiftState$5 = TShiftState.Current();
         TShiftState.SetMouseEvent(shiftState$5,eventObj$13);
         mousePos.X$1 = eventObj$13.clientX-sr$6.Left$1;
         mousePos.Y$1 = eventObj$13.clientY-sr$6.Top$1;
         TW3CustomControl.MouseWheel(Self,shiftState$5,wheelDelta$1,mousePos,handled$1);
         if (handled$1.v) {
            eventObj$13.preventDefault();
            eventObj$13.stopPropagation();
         }
      }
   }
   /// procedure TW3CustomControl.CMGestureChange()
   ///  [line: 2657, column: 28, file: SmartCL.Components]
   ,CMGestureChange:function(Self) {
      event.preventDefault();
      if (Self.FOnGestureChange) {
         if (!Self.FGestureData) {
            Self.FGestureData = TObject.Create($New(TW3GestureData));
         } else {
            TW3GestureData.Update$2(Self.FGestureData);
         }
         Self.FOnGestureChange(Self,Self.FGestureData);
      }
   }
   /// procedure TW3CustomControl.CMGestureEnd()
   ///  [line: 2685, column: 28, file: SmartCL.Components]
   ,CMGestureEnd:function(Self) {
      event.preventDefault();
      if (Self.FOnGestureEnd) {
         if (!Self.FGestureData) {
            Self.FGestureData = TObject.Create($New(TW3GestureData));
         } else {
            TW3GestureData.Update$2(Self.FGestureData);
         }
         Self.FOnGestureEnd(Self,Self.FGestureData);
      }
   }
   /// procedure TW3CustomControl.CMGestureStart()
   ///  [line: 2629, column: 28, file: SmartCL.Components]
   ,CMGestureStart:function(Self) {
      event.preventDefault();
      if (Self.FOnGestureStart) {
         if (!Self.FGestureData) {
            Self.FGestureData = TObject.Create($New(TW3GestureData));
         } else {
            TW3GestureData.Update$2(Self.FGestureData);
         }
         Self.FOnGestureStart(Self,Self.FGestureData);
      }
   }
   /// procedure TW3CustomControl.CMTouchBegins(eventObj: JTouchEvent)
   ///  [line: 2561, column: 28, file: SmartCL.Components]
   ,CMTouchBegins:function(Self, eventObj$14) {
      eventObj$14.preventDefault();
      if (Self.FOnTouchBegins) {
         if (!Self.FTouchData) {
            Self.FTouchData = TObject.Create($New(TW3TouchData));
         } else {
            TW3TouchData.Update$1(Self.FTouchData,eventObj$14);
         }
         Self.FOnTouchBegins(Self,Self.FTouchData);
      }
   }
   /// procedure TW3CustomControl.CMTouchEnds(eventObj: JTouchEvent)
   ///  [line: 2601, column: 28, file: SmartCL.Components]
   ,CMTouchEnds:function(Self, eventObj$15) {
      eventObj$15.preventDefault();
      if (Self.FOnTouchEnds) {
         if (!Self.FTouchData) {
            Self.FTouchData = TObject.Create($New(TW3TouchData));
         } else {
            TW3TouchData.Update$1(Self.FTouchData,eventObj$15);
         }
         Self.FOnTouchEnds(Self,Self.FTouchData);
      }
   }
   /// procedure TW3CustomControl.CMTouchMove(eventObj: JTouchEvent)
   ///  [line: 2581, column: 28, file: SmartCL.Components]
   ,CMTouchMove:function(Self, eventObj$16) {
      eventObj$16.preventDefault();
      if (Self.FOnTouchMoves) {
         if (!Self.FTouchData) {
            Self.FTouchData = TObject.Create($New(TW3TouchData));
         } else {
            TW3TouchData.Update$1(Self.FTouchData,eventObj$16);
         }
         Self.FOnTouchMoves(Self,Self.FTouchData);
      }
   }
   /// procedure TW3CustomControl.ContextPopup(const mousePos: TPoint; var handled: Boolean)
   ///  [line: 2728, column: 28, file: SmartCL.Components]
   ,ContextPopup:function(Self, mousePos$1, handled$2) {
      if (Self.FOnContextPopup) {
         Self.FOnContextPopup(Self,mousePos$1,handled$2);
      }
   }
   /// constructor TW3CustomControl.Create(AOwner: TW3Component)
   ///  [line: 1977, column: 30, file: SmartCL.Components]
   ,Create$18:function(Self, AOwner$2) {
      TW3Component.Create$18(Self,AOwner$2);
      Self.FHandle["onclick"] = $Event1(Self,TW3CustomControl.CBClick$);
      return Self
   }
   /// procedure TW3CustomControl.FinalizeObject()
   ///  [line: 1998, column: 28, file: SmartCL.Components]
   ,FinalizeObject:function(Self) {
      TObject.Free(Self.FFont);
      TObject.Free(Self.FClassNames);
      TObject.Free(Self.FScrollInfo);
      TObject.Free(Self.FTouchData);
      TObject.Free(Self.FGestureData);
      TW3MovableControl.FinalizeObject(Self);
   }
   /// function TW3CustomControl.GetBorderRadius() : Integer
   ///  [line: 2765, column: 27, file: SmartCL.Components]
   ,GetBorderRadius:function(Self) {
      var Result = 0;
      Result = w3_getStyleAsInt(Self.FHandle,"bordertopleftRadius");
      return Result
   }
   /// function TW3CustomControl.GetChildrenSortedByYPos() : TW3ComponentArray
   ///  [line: 2170, column: 27, file: SmartCL.Components]
   ,GetChildrenSortedByYPos:function(Self) {
      var Result = [];
      var mCount = 0;
      var x$2 = 0;
      var mAltered = false;
      var mObj$1 = null;
      var mLast = null;
      var mCurrent = null;
      Result.length=0;
      mCount = TW3Component.GetChildCount(Self);
      if (mCount>0) {
         var $temp3;
         for(x$2 = 0,$temp3 = mCount;x$2<$temp3;x$2++) {
            mObj$1 = TW3Component.GetChildObject(Self,x$2);
            if ($Is(mObj$1,TW3CustomControl)) {
               Result.push(mObj$1);
            }
         }
         if (Result.length>1) {
            do {
               mAltered = false;
               var $temp4;
               for(x$2 = 1,$temp4 = mCount;x$2<$temp4;x$2++) {
                  mLast = $As(Result[x$2-1],TW3CustomControl);
                  mCurrent = $As(Result[x$2],TW3CustomControl);
                  if (TW3MovableControl.GetTop(mCurrent)<TW3MovableControl.GetTop(mLast)) {
                     $ArraySwap(Result,(x$2-1),x$2);
                     mAltered = true;
                  }
               }
            } while (!(mAltered==false));
         }
      }
      return Result
   }
   /// function TW3CustomControl.GetClassNames() : TW3CSSClassStyleNames
   ///  [line: 2043, column: 27, file: SmartCL.Components]
   ,GetClassNames:function(Self) {
      var Result = null;
      if (Self.FClassNames===null) {
         Self.FClassNames = TW3OwnedObject.Create$4$($New(TW3CSSClassStyleNames),Self);
      }
      Result = Self.FClassNames;
      return Result
   }
   /// function TW3CustomControl.GetEnabled() : Boolean
   ///  [line: 2057, column: 27, file: SmartCL.Components]
   ,GetEnabled:function(Self) {
      var Result = false;
      Result = Self.FHandle.disabled!=true;
      return Result
   }
   /// function TW3CustomControl.GetFont() : TW3ControlFont
   ///  [line: 2026, column: 27, file: SmartCL.Components]
   ,GetFont:function(Self) {
      var Result = null;
      if (Self.FFont===null) {
         Self.FFont = TW3ControlFont.Create$36($New(TW3ControlFont),Self);
      }
      Result = Self.FFont;
      return Result
   }
   /// function TW3CustomControl.GetHasFocus() : Boolean
   ///  [line: 2241, column: 27, file: SmartCL.Components]
   ,GetHasFocus:function(Self) {
      var Result = false;
      if (Self.FHandle) {
         Result = document.activeElement==Self.FHandle;
      }
      return Result
   }
   /// function TW3CustomControl.GetMaxZIndex() : Integer
   ///  [line: 2148, column: 27, file: SmartCL.Components]
   ,GetMaxZIndex:function(Self) {
      var Result = 0;
      var iChild = 0;
      var obj = null;
      var objZIndex = 0;
      Result = 0;
      var $temp5;
      for(iChild = 0,$temp5 = TW3Component.GetChildCount(Self);iChild<$temp5;iChild++) {
         obj = TW3Component.GetChildObject(Self,iChild);
         if (((obj!==null)&&$Is(obj,TW3CustomControl))&&obj.FHandle) {
            objZIndex = TW3CustomControl.GetZIndexAsInt($As(obj,TW3CustomControl),0);
            if (objZIndex>Result) {
               Result = objZIndex;
            }
            objZIndex = TW3CustomControl.GetMaxZIndex($As(obj,TW3CustomControl));
            if (objZIndex>Result) {
               Result = objZIndex;
            }
         }
      }
      return Result
   }
   /// function TW3CustomControl.GetScrollInfo() : TW3ScrollInfo
   ///  [line: 2050, column: 27, file: SmartCL.Components]
   ,GetScrollInfo:function(Self) {
      var Result = null;
      if (Self.FScrollInfo===null) {
         Self.FScrollInfo = TW3OwnedObject.Create$4$($New(TW3ScrollInfo),Self);
      }
      Result = Self.FScrollInfo;
      return Result
   }
   /// function TW3CustomControl.GetStyleClass() : String
   ///  [line: 2213, column: 27, file: SmartCL.Components]
   ,GetStyleClass:function(Self) {
      var Result = "";
      Result = w3_getAttribAsStr(Self.FHandle,"class");
      return Result
   }
   /// function TW3CustomControl.GetZIndexAsInt(default: Integer = 0) : Integer
   ///  [line: 2091, column: 27, file: SmartCL.Components]
   ,GetZIndexAsInt:function(Self, default$1) {
      var Result = 0;
      var mData$3;
      Result = default$1;
      mData$3 = Self.FHandle.style["zIndex"];
      if (Self.FHandle) {
         if (TVariant.IsNumber(mData$3)) {
            Result = parseInt(mData$3,10);
         } else if (TVariant.IsString(mData$3)) {
            Result = parseInt(mData$3,10);
            if (isNaN(Result)) {
               Result = default$1;
            }
         }
      }
      return Result
   }
   /// function TW3CustomControl.GetZoom() : Float
   ///  [line: 2033, column: 27, file: SmartCL.Components]
   ,GetZoom:function(Self) {
      var Result = 0;
      Result = w3_getStyleAsFloat(Self.FHandle,"zoom");
      return Result
   }
   /// procedure TW3CustomControl.InitializeCapture()
   ///  [line: 36, column: 34, file: SmartCL.MouseCapture]
   ,InitializeCapture:function(Self) {
      var doc = undefined;
      doc = document;
      doc.addEventListener("mousedown",function (evt) {
         if (vCaptureControl!==null) {
            TW3CustomControl.CBMouseDown$(vCaptureControl,evt);
            evt.stopImmediatePropagation();
         }
      },true);
      doc.addEventListener("mousemove",function (evt$1) {
         if (vCaptureControl!==null) {
            TW3CustomControl.CBMouseMove$(vCaptureControl,evt$1);
            evt$1.stopImmediatePropagation();
         }
      },true);
      doc.addEventListener("mouseup",function (evt$2) {
         if (vCaptureControl!==null) {
            TW3CustomControl.CBMouseUp$(vCaptureControl,evt$2);
            evt$2.stopImmediatePropagation();
         }
         vCaptureControl = null;
      },true);
      doc.addEventListener("mouseover",function (evt$3) {
         if (vCaptureControl!==null) {
            TW3CustomControl.CBMouseEnter(vCaptureControl,evt$3);
            evt$3.stopImmediatePropagation();
         }
      },true);
      doc.addEventListener("mouseout",function (evt$4) {
         if (vCaptureControl!==null) {
            TW3CustomControl.CBMouseExit(vCaptureControl,evt$4);
            evt$4.stopImmediatePropagation();
         }
      },true);
      doc.addEventListener("mousewheel",function (evt$5) {
         if (vCaptureControl!==null) {
            TW3CustomControl.CBMouseWheel(vCaptureControl,evt$5);
            evt$5.stopImmediatePropagation();
         }
      },true);
      doc.addEventListener("onclick",function (evt$6) {
         if (vCaptureControl!==null) {
            TW3CustomControl.CBClick$(vCaptureControl,evt$6);
            evt$6.stopImmediatePropagation();
         }
      },true);
      doc.addEventListener("ondblclick",function (evt$7) {
         if (vCaptureControl!==null) {
            TW3CustomControl.CBDblClick(vCaptureControl,evt$7);
            evt$7.stopImmediatePropagation();
         }
      },true);
      vCaptureInitialized = true;
   }
   /// procedure TW3CustomControl.InitializeObject()
   ///  [line: 1983, column: 28, file: SmartCL.Components]
   ,InitializeObject:function(Self) {
      TW3MovableControl.InitializeObject(Self);
      Self.FNoBehavior = $Event0(Self,TW3Component.CBNoBehavior);
      w3_bind2(Self.FHandle,"onselectstart",$Event0(Self,TW3Component.CBNoBehavior));
      w3_bind2(Self.FHandle,"onfocus",$Event0(Self,TW3CustomControl.CBFocused));
      w3_bind2(Self.FHandle,"onblur",$Event0(Self,TW3CustomControl.CBLostFocus));
   }
   /// procedure TW3CustomControl.Invalidate()
   ///  [line: 2734, column: 28, file: SmartCL.Components]
   ,Invalidate:function(Self) {
   }
   /// procedure TW3CustomControl.LayoutChildren()
   ///  [line: 2739, column: 28, file: SmartCL.Components]
   ,LayoutChildren:function(Self) {
      var x$3 = 0;
      var mChild$1 = null;
      TW3TagObj.BeginUpdate(Self);
      try {
         var $temp6;
         for(x$3 = 0,$temp6 = TW3Component.GetChildCount(Self);x$3<$temp6;x$3++) {
            mChild$1 = TW3Component.GetChildObject(Self,x$3);
            if ($Is(mChild$1,TW3CustomControl)) {
               setTimeout($Event0($As(mChild$1,TW3CustomControl),TW3CustomControl.LayoutChildren),10);
            }
         }
      } finally {
         TW3MovableControl.SetWasSized(Self);
         TW3TagObj.EndUpdate(Self);
      }
   }
   /// procedure TW3CustomControl.MouseDown(button: TMouseButton; shiftState: TShiftState; x: Integer; y: Integer)
   ///  [line: 2279, column: 28, file: SmartCL.Components]
   ,MouseDown:function(Self, button$3, shiftState$6, x$4, y) {
      if (Self.FOnMouseDown) {
         Self.FOnMouseDown(Self,button$3,shiftState$6,x$4,y);
      }
   }
   /// procedure TW3CustomControl.MouseEnter(shiftState: TShiftState; x: Integer; y: Integer)
   ///  [line: 2343, column: 28, file: SmartCL.Components]
   ,MouseEnter:function(Self, shiftState$7, x$5, y$1) {
      if (Self.FOnMouseEnter) {
         Self.FOnMouseEnter(Self,shiftState$7,x$5,y$1);
      }
   }
   /// procedure TW3CustomControl.MouseExit(shiftState: TShiftState; x: Integer; y: Integer)
   ///  [line: 2367, column: 28, file: SmartCL.Components]
   ,MouseExit:function(Self, shiftState$8, x$6, y$2) {
      if (Self.FOnMouseExit) {
         Self.FOnMouseExit(Self,shiftState$8,x$6,y$2);
      }
   }
   /// procedure TW3CustomControl.MouseMove(shiftState: TShiftState; x: Integer; y: Integer)
   ///  [line: 2321, column: 28, file: SmartCL.Components]
   ,MouseMove:function(Self, shiftState$9, x$7, y$3) {
      if (Self.FOnMouseMove) {
         Self.FOnMouseMove(Self,shiftState$9,x$7,y$3);
      }
   }
   /// procedure TW3CustomControl.MouseUp(button: TMouseButton; shiftState: TShiftState; x: Integer; y: Integer)
   ///  [line: 2301, column: 28, file: SmartCL.Components]
   ,MouseUp:function(Self, button$4, shiftState$10, x$8, y$4) {
      if (Self.FOnMouseUp) {
         Self.FOnMouseUp(Self,button$4,shiftState$10,x$8,y$4);
      }
   }
   /// procedure TW3CustomControl.MouseWheel(shift: TShiftState; wheelDelta: Integer; const mousePos: TPoint; var handled: Boolean)
   ///  [line: 2418, column: 28, file: SmartCL.Components]
   ,MouseWheel:function(Self, shift, wheelDelta$2, mousePos$2, handled$3) {
      if (Self.FOnMouseWheel) {
         Self.FOnMouseWheel(Self,shift,wheelDelta$2,mousePos$2,handled$3);
      }
   }
   /// procedure TW3CustomControl.ReleaseCapture()
   ///  [line: 112, column: 28, file: SmartCL.MouseCapture]
   ,ReleaseCapture:function(Self) {
      --Self.FMouseCaptured;
      if (Self.FMouseCaptured==0) {
         if (Self.FHandle.releaseCapture) {
            Self.FHandle.releaseCapture();
         }
         vCaptureControl = null;
      } else if (Self.FMouseCaptured<0) {
         Self.FMouseCaptured = 0;
      }
   }
   /// procedure TW3CustomControl.SendToBack()
   ///  [line: 2109, column: 28, file: SmartCL.Components]
   ,SendToBack:function(Self) {
      var iChild$1 = 0;
      var obj$1 = null;
      var pushUp = 0;
      var minZIndex = 0;
      var objZIndex$1 = 0;
      var objZIndex$2 = 0;
      if (Self.FHandle) {
         minZIndex = 99999;
         if ((Self.FParent!==null)&&$Is(Self.FParent,TW3Component)) {
            var $temp7;
            for(iChild$1 = 0,$temp7 = TW3Component.GetChildCount(Self.FParent);iChild$1<$temp7;iChild$1++) {
               obj$1 = TW3Component.GetChildObject(Self.FParent,iChild$1);
               if (((obj$1!==null)&&$Is(obj$1,TW3CustomControl))&&obj$1.FHandle) {
                  objZIndex$1 = TW3CustomControl.GetZIndexAsInt($As(obj$1,TW3CustomControl),99999);
                  if (objZIndex$1<minZIndex) {
                     minZIndex = objZIndex$1;
                  }
               }
            }
         }
         if (minZIndex==99999) {
            minZIndex = 0;
         }
         if ((Self.FParent!==null)&&$Is(Self.FParent,TW3Component)) {
            if (minZIndex<0) {
               pushUp = -minZIndex;
            } else {
               pushUp = 1;
            }
            var $temp8;
            for(iChild$1 = 0,$temp8 = TW3Component.GetChildCount(Self.FParent);iChild$1<$temp8;iChild$1++) {
               obj$1 = TW3Component.GetChildObject(Self.FParent,iChild$1);
               if ((((obj$1!==null)&&(obj$1!==Self))&&$Is(obj$1,TW3CustomControl))&&obj$1.FHandle) {
                  objZIndex$2 = TW3CustomControl.GetZIndexAsInt($As(obj$1,TW3CustomControl),-1);
                  if (objZIndex$2<0) {
                     obj$1.FHandle.style.zIndex = (minZIndex+pushUp+1);
                  } else {
                     obj$1.FHandle.style.zIndex = (objZIndex$2+pushUp);
                  }
               }
            }
         }
         Self.FHandle.style.zIndex = ((minZIndex+pushUp)-1);
      }
   }
   /// procedure TW3CustomControl.SetAngle(aValue: Float)
   ///  [line: 2223, column: 28, file: SmartCL.Components]
   ,SetAngle:function(Self, aValue$23) {
      var mStyle = "";
      if (aValue$23!=Self.FAngle) {
         Self.FAngle = aValue$23;
         mStyle = "rotate("+FloatToStr$_Float_Integer_(aValue$23,2)+"deg)";
         w3_setStyle(Self.FHandle,w3_CSSPrefix("Transform"),mStyle);
      }
   }
   /// procedure TW3CustomControl.SetBorderRadius(aNewRadius: Integer)
   ///  [line: 2776, column: 28, file: SmartCL.Components]
   ,SetBorderRadius:function(Self, aNewRadius) {
      TW3TagObj.BeginUpdate(Self);
      w3_setStyle(Self.FHandle,"borderRadius",TInteger.ToPxStr(aNewRadius));
      TW3MovableControl.SetWasSized(Self);
      TW3TagObj.EndUpdate(Self);
   }
   /// procedure TW3CustomControl.SetCapture()
   ///  [line: 100, column: 28, file: SmartCL.MouseCapture]
   ,SetCapture:function(Self) {
      if (Self.FMouseCaptured==0) {
         if (Self.FHandle.setCapture) {
            Self.FHandle.setCapture(true);
         } else if (!vCaptureInitialized) {
            TW3CustomControl.InitializeCapture(Self.ClassType);
         }
         vCaptureControl = Self;
      }
      ++Self.FMouseCaptured;
   }
   /// procedure TW3CustomControl.SetEnabled(aValue: Boolean)
   ///  [line: 2062, column: 28, file: SmartCL.Components]
   ,SetEnabled:function(Self, aValue$24) {
      Self.FHandle.disabled = (!aValue$24);
   }
   /// procedure TW3CustomControl.SetFocus()
   ///  [line: 2235, column: 28, file: SmartCL.Components]
   ,SetFocus:function(Self) {
      if (Self.FHandle) {
         Self.FHandle.focus();
      }
   }
   /// procedure TW3CustomControl.SetStyleClass(aStyle: String)
   ///  [line: 2218, column: 28, file: SmartCL.Components]
   ,SetStyleClass:function(Self, aStyle) {
      w3_setAttrib(Self.FHandle,"class",aStyle);
   }
   /// procedure TW3CustomControl.SetZoom(aValue: Float)
   ///  [line: 2038, column: 28, file: SmartCL.Components]
   ,SetZoom:function(Self, aValue$25) {
      w3_setStyle(Self.FHandle,"zoom",aValue$25);
   }
   /// procedure TW3CustomControl.StyleTagObject()
   ///  [line: 2019, column: 28, file: SmartCL.Components]
   ,StyleTagObject:function(Self) {
      TW3TagObj.StyleTagObject(Self);
      TW3CustomControl.SetStyleClass(Self,TObject.ClassName(Self.ClassType));
      TW3MovableControl.SetVisible(Self,true);
   }
   /// procedure TW3CustomControl._setAnimationBegins(const aValue: TAnimationBeginsEvent)
   ///  [line: 2500, column: 28, file: SmartCL.Components]
   ,_setAnimationBegins:function(Self, aValue$26) {
      if (aValue$26) {
         Self.FHandle[w3_CSSPrefix("AnimationStart")] = $Event1(Self,TW3CustomControl.CBAnimationBegins);
      } else {
         Self.FHandle[w3_CSSPrefix("AnimationStart")] = Self.FNoBehavior;
      }
      Self.FOnAnimationBegins = aValue$26;
   }
   /// procedure TW3CustomControl._setAnimationEnds(const aValue: TAnimationEndsEvent)
   ///  [line: 2515, column: 28, file: SmartCL.Components]
   ,_setAnimationEnds:function(Self, aValue$27) {
      if (aValue$27) {
         Self.FHandle[w3_CSSPrefix("AnimationEnd")] = $Event1(Self,TW3CustomControl.CBAnimationEnds);
      } else {
         Self.FHandle[w3_CSSPrefix("AnimationEnd")] = Self.FNoBehavior;
      }
      Self.FOnAnimationEnds = aValue$27;
   }
   /// procedure TW3CustomControl._setChanged(const aValue: TChangedEvent)
   ///  [line: 2530, column: 28, file: SmartCL.Components]
   ,_setChanged:function(Self, aValue$28) {
      if (aValue$28) {
         Self.FHandle["onchange"] = $Event1(Self,TW3CustomControl.CBChanged);
      } else {
         Self.FHandle["onchange"] = Self.FNoBehavior;
      }
      Self.FOnChanged = aValue$28;
   }
   /// procedure TW3CustomControl._setContextPopup(const aValue: TContextPopupEvent)
   ///  [line: 2707, column: 28, file: SmartCL.Components]
   ,_setContextPopup:function(Self, aValue$29) {
      var mObj$2 = undefined;
      mObj$2 = Self.FHandle;
      if (aValue$29) {
         mObj$2["oncontextmenu"] = $Event1(Self,TW3CustomControl.CBContextPopup);
      } else {
         mObj$2["oncontextmenu"] = Self.FNoBehavior;
      }
      Self.FOnContextPopup = aValue$29;
   }
   /// procedure TW3CustomControl._setGestureChange(aValue: TGestureChangeEvent)
   ///  [line: 2642, column: 28, file: SmartCL.Components]
   ,_setGestureChange:function(Self, aValue$30) {
      if (Self.FOnGestureChange) {
         w3_RemoveEvent(Self.FHandle,"gesturechange",$Event0(Self,TW3CustomControl.CMGestureChange),true);
         Self.FOnGestureChange = null;
      }
      if (aValue$30) {
         Self.FOnGestureChange = aValue$30;
         w3_AddEvent(Self.FHandle,"gesturechange",$Event0(Self,TW3CustomControl.CMGestureChange),true);
      }
   }
   /// procedure TW3CustomControl._setGestureEnd(aValue: TGestureEndEvent)
   ///  [line: 2670, column: 28, file: SmartCL.Components]
   ,_setGestureEnd:function(Self, aValue$31) {
      if (Self.FOnGestureEnd) {
         w3_RemoveEvent(Self.FHandle,"gesturestart",$Event0(Self,TW3CustomControl.CMGestureEnd),true);
         Self.FOnGestureEnd = null;
      }
      if (aValue$31) {
         Self.FOnGestureEnd = aValue$31;
         w3_AddEvent(Self.FHandle,"gestureend",$Event0(Self,TW3CustomControl.CMGestureEnd),true);
      }
   }
   /// procedure TW3CustomControl._setGestureStart(aValue: TGestureStartEvent)
   ///  [line: 2614, column: 28, file: SmartCL.Components]
   ,_setGestureStart:function(Self, aValue$32) {
      if (Self.FOnGestureStart) {
         w3_RemoveEvent(Self.FHandle,"gesturestart",$Event0(Self,TW3CustomControl.CMGestureStart),true);
         Self.FOnGestureStart = null;
      }
      if (aValue$32) {
         Self.FOnGestureStart = aValue$32;
         w3_AddEvent(Self.FHandle,"gesturestart",$Event0(Self,TW3CustomControl.CMGestureStart),true);
      }
   }
   /// procedure TW3CustomControl._setGotFocus(const aValue: TGotFocusEvent)
   ///  [line: 2247, column: 28, file: SmartCL.Components]
   ,_setGotFocus:function(Self, aValue$33) {
      Self.FOnGotFocus = aValue$33;
   }
   /// procedure TW3CustomControl._setKeyDown(const aValue: TKeyDownEvent)
   ///  [line: 2461, column: 28, file: SmartCL.Components]
   ,_setKeyDown:function(Self, aValue$34) {
      Self.FHandle["onkeydown"] = $Event1(Self,TW3CustomControl.CBKeyDown$);
      Self.FOnKeyDown = aValue$34;
   }
   /// procedure TW3CustomControl._setKeyPress(const aValue: TKeyPressEvent)
   ///  [line: 2485, column: 28, file: SmartCL.Components]
   ,_setKeyPress:function(Self, aValue$35) {
      if (aValue$35) {
         Self.FHandle["onkeypress"] = $Event1(Self,TW3CustomControl.CBKeyPress);
      } else {
         Self.FHandle["onkeypress"] = Self.FNoBehavior;
      }
      Self.FOnKeyPress = aValue$35;
   }
   /// procedure TW3CustomControl._setKeyUp(const aValue: TKeyUpEvent)
   ///  [line: 2473, column: 28, file: SmartCL.Components]
   ,_setKeyUp:function(Self, aValue$36) {
      Self.FHandle["onkeyup"] = $Event1(Self,TW3CustomControl.CBKeyUp$);
      Self.FOnKeyUp = aValue$36;
   }
   /// procedure TW3CustomControl._setLostFocus(const aValue: TLostFocusEvent)
   ///  [line: 2256, column: 28, file: SmartCL.Components]
   ,_setLostFocus:function(Self, aValue$37) {
      Self.FOnLostFocus = aValue$37;
   }
   /// procedure TW3CustomControl._setMouseClick(const aValue: TMouseClickEvent)
   ///  [line: 2425, column: 28, file: SmartCL.Components]
   ,_setMouseClick:function(Self, aValue$38) {
      Self.FOnClick = aValue$38;
   }
   /// procedure TW3CustomControl._setMouseDblClick(const aValue: TMouseDblClickEvent)
   ///  [line: 2441, column: 28, file: SmartCL.Components]
   ,_setMouseDblClick:function(Self, aValue$39) {
      if (aValue$39) {
         Self.FHandle["ondblclick"] = $Event1(Self,TW3CustomControl.CBDblClick);
      } else {
         Self.FHandle["ondblclick"] = Self.FNoBehavior;
      }
      Self.FOnDblClick = aValue$39;
   }
   /// procedure TW3CustomControl._setMouseDown(const aValue: TMouseDownEvent)
   ///  [line: 2262, column: 28, file: SmartCL.Components]
   ,_setMouseDown:function(Self, aValue$40) {
      Self.FHandle["onmousedown"] = $Event1(Self,TW3CustomControl.CBMouseDown$);
      Self.FOnMouseDown = aValue$40;
   }
   /// procedure TW3CustomControl._setMouseEnter(const aValue: TMouseEnterEvent)
   ///  [line: 2327, column: 28, file: SmartCL.Components]
   ,_setMouseEnter:function(Self, aValue$41) {
      if (aValue$41) {
         Self.FHandle["onmouseover"] = $Event1(Self,TW3CustomControl.CBMouseEnter);
      } else {
         Self.FHandle["onmouseover"] = Self.FNoBehavior;
      }
      Self.FOnMouseEnter = aValue$41;
   }
   /// procedure TW3CustomControl._setMouseExit(const aValue: TMouseExitEvent)
   ///  [line: 2349, column: 28, file: SmartCL.Components]
   ,_setMouseExit:function(Self, aValue$42) {
      if (aValue$42) {
         Self.FHandle["onmouseout"] = $Event1(Self,TW3CustomControl.CBMouseExit);
      } else {
         Self.FHandle["onmouseout"] = Self.FNoBehavior;
      }
      Self.FOnMouseExit = aValue$42;
   }
   /// procedure TW3CustomControl._setMouseMove(const aValue: TMouseMoveEvent)
   ///  [line: 2307, column: 28, file: SmartCL.Components]
   ,_setMouseMove:function(Self, aValue$43) {
      Self.FHandle["onmousemove"] = $Event1(Self,TW3CustomControl.CBMouseMove$);
      Self.FOnMouseMove = aValue$43;
   }
   /// procedure TW3CustomControl._setMouseUp(const aValue: TMouseUpEvent)
   ///  [line: 2285, column: 28, file: SmartCL.Components]
   ,_setMouseUp:function(Self, aValue$44) {
      Self.FHandle["onmouseup"] = $Event1(Self,TW3CustomControl.CBMouseUp$);
      Self.FOnMouseUp = aValue$44;
   }
   /// procedure TW3CustomControl._setMouseWheel(const aValue: TMouseWheelEvent)
   ///  [line: 2373, column: 28, file: SmartCL.Components]
   ,_setMouseWheel:function(Self, aValue$45) {
      var onEventSupported = false;
      var mObj$3 = undefined;
      mObj$3 = Self.FHandle;
      
    onEventSupported = 'onmousewheel' in mObj$3;
  if (onEventSupported) {
         if (aValue$45) {
            mObj$3["onmousewheel"] = $Event1(Self,TW3CustomControl.CBMouseWheel);
         } else {
            mObj$3["onmousewheel"] = Self.FNoBehavior;
         }
      } else {
         if (aValue$45) {
            mObj$3.addEventListener("DOMMouseScroll",$Event1(Self,TW3CustomControl.CBMouseWheel),false);
         } else {
            mObj$3.removeEventListener("DOMMouseScroll",$Event1(Self,TW3CustomControl.CBMouseWheel),false);
         }
      }
      Self.FOnMouseWheel = aValue$45;
   }
   /// procedure TW3CustomControl._setResize(const aValue: TReSizeEvent)
   ///  [line: 2702, column: 28, file: SmartCL.Components]
   ,_setResize:function(Self, aValue$46) {
      Self.FOnResize = aValue$46;
   }
   /// procedure TW3CustomControl._setTouchBegins(const aValue: TTouchBeginEvent)
   ///  [line: 2554, column: 28, file: SmartCL.Components]
   ,_setTouchBegins:function(Self, aValue$47) {
      if (aValue$47) {
         TW3CustomControl.BindTouch(Self);
      }
      Self.FOnTouchBegins = aValue$47;
   }
   /// procedure TW3CustomControl._setTouchEnds(const aValue: TTouchEndEvent)
   ///  [line: 2594, column: 28, file: SmartCL.Components]
   ,_setTouchEnds:function(Self, aValue$48) {
      if (aValue$48) {
         TW3CustomControl.BindTouch(Self);
      }
      Self.FOnTouchEnds = aValue$48;
   }
   /// procedure TW3CustomControl._setTouchMoves(const aValue: TTouchMoveEvent)
   ///  [line: 2574, column: 28, file: SmartCL.Components]
   ,_setTouchMoves:function(Self, aValue$49) {
      if (aValue$49) {
         TW3CustomControl.BindTouch(Self);
      }
      Self.FOnTouchMoves = aValue$49;
   }
   ,Destroy:TW3TagObj.Destroy
   ,AfterUpdate$:function($){return $.ClassType.AfterUpdate($)}
   ,FinalizeObject$:function($){return $.ClassType.FinalizeObject($)}
   ,InitializeObject$:function($){return $.ClassType.InitializeObject($)}
   ,MakeElementTagId:TW3TagObj.MakeElementTagId
   ,MakeElementTagObj:TW3TagObj.MakeElementTagObj
   ,StyleTagObject$:function($){return $.ClassType.StyleTagObject($)}
   ,ChildAdded:TW3Component.ChildAdded
   ,Create$18$:function($){return $.ClassType.Create$18.apply($.ClassType, arguments)}
   ,GetHeight:TW3MovableControl.GetHeight
   ,GetWidth:TW3MovableControl.GetWidth
   ,Resize:TW3MovableControl.Resize
   ,SetHeight:TW3MovableControl.SetHeight
   ,SetWidth:TW3MovableControl.SetWidth
   ,supportAdjustment:TW3MovableControl.supportAdjustment
   ,CBClick$:function($){return $.ClassType.CBClick.apply($.ClassType, arguments)}
   ,CBKeyDown$:function($){return $.ClassType.CBKeyDown.apply($.ClassType, arguments)}
   ,CBKeyUp$:function($){return $.ClassType.CBKeyUp.apply($.ClassType, arguments)}
   ,CBMouseDown$:function($){return $.ClassType.CBMouseDown.apply($.ClassType, arguments)}
   ,CBMouseMove$:function($){return $.ClassType.CBMouseMove.apply($.ClassType, arguments)}
   ,CBMouseUp$:function($){return $.ClassType.CBMouseUp.apply($.ClassType, arguments)}
   ,GetEnabled$:function($){return $.ClassType.GetEnabled($)}
   ,Invalidate$:function($){return $.ClassType.Invalidate($)}
   ,SetEnabled$:function($){return $.ClassType.SetEnabled.apply($.ClassType, arguments)}
};
/// TW3DisplayView = class (TW3CustomControl)
///  [line: 41, column: 3, file: SmartCL.Application]
var TW3DisplayView = {
   $ClassName:"TW3DisplayView",
   $Parent:TW3CustomControl
   ,$Init:function ($) {
      TW3CustomControl.$Init($);
      $.FArrange = false;
      $.FArrangeKind = 0;
   }
   /// procedure TW3DisplayView.ArrangeChildren(aKind: TW3DisplayViewArangeType)
   ///  [line: 293, column: 26, file: SmartCL.Application]
   ,ArrangeChildren:function(Self, aKind) {
      var x$9 = 0;
      var dx$1 = 0;
      var dy$1 = 0;
      var mObj$4 = null;
      var mCount$1 = 0;
      var mRect = {Bottom$1:0,Left$1:0,Right$1:0,Top$1:0};
      var wd = 0;
      var hd = 0;
      mCount$1 = TW3Component.GetChildCount(Self);
      if (mCount$1>0) {
         mRect = TW3MovableControl.GetBoundsRect(Self);
         switch (aKind) {
            case 0 :
               wd = TRect$Width$1(mRect);
               hd = TRect$Height$1(mRect);
               var $temp9;
               for(x$9 = 0,$temp9 = mCount$1;x$9<$temp9;x$9++) {
                  mObj$4 = TW3Component.GetChildObject(Self,x$9);
                  if ($Is(mObj$4,TW3CustomControl)&&(!$Is(mObj$4,TW3BlockBox))) {
                     TW3MovableControl.SetSize($As(mObj$4,TW3CustomControl),wd,hd);
                  }
               }
               break;
            case 1 :
               dy$1 = mRect.Top$1;
               wd = TRect$Width$1(mRect);
               var $temp10;
               for(x$9 = 0,$temp10 = mCount$1;x$9<$temp10;x$9++) {
                  mObj$4 = TW3Component.GetChildObject(Self,x$9);
                  if ($Is(mObj$4,TW3CustomControl)&&(!$Is(mObj$4,TW3BlockBox))) {
                     hd = TW3MovableControl.GetHeight$($As(mObj$4,TW3CustomControl));
                     TW3MovableControl.SetBounds$2($As(mObj$4,TW3CustomControl),mRect.Left$1,dy$1,wd,hd);
                     (dy$1+= hd);
                  }
               }
               break;
            case 2 :
               dx$1 = mRect.Left$1;
               hd = TRect$Height$1(mRect);
               var $temp11;
               for(x$9 = 0,$temp11 = mCount$1;x$9<$temp11;x$9++) {
                  mObj$4 = TW3Component.GetChildObject(Self,x$9);
                  if ($Is(mObj$4,TW3CustomControl)&&(!$Is(mObj$4,TW3BlockBox))) {
                     wd = TW3MovableControl.GetWidth$($As(mObj$4,TW3CustomControl));
                     TW3MovableControl.SetBounds$2($As(mObj$4,TW3CustomControl),dx$1,mRect.Top$1,wd,hd);
                     (dx$1+= wd);
                  }
               }
               break;
         }
      }
   }
   /// procedure TW3DisplayView.InitializeObject()
   ///  [line: 245, column: 26, file: SmartCL.Application]
   ,InitializeObject:function(Self) {
      TW3CustomControl.InitializeObject(Self);
      Self.FArrange = true;
      Self.FArrangeKind = 0;
   }
   /// procedure TW3DisplayView.ReSize()
   ///  [line: 378, column: 26, file: SmartCL.Application]
   ,Resize:function(Self) {
      TW3MovableControl.Resize(Self);
      if (Self.FArrange) {
         TW3DisplayView.ArrangeChildren(Self,Self.FArrangeKind);
      }
   }
   ,Destroy:TW3TagObj.Destroy
   ,AfterUpdate:TW3CustomControl.AfterUpdate
   ,FinalizeObject:TW3CustomControl.FinalizeObject
   ,InitializeObject$:function($){return $.ClassType.InitializeObject($)}
   ,MakeElementTagId:TW3TagObj.MakeElementTagId
   ,MakeElementTagObj:TW3TagObj.MakeElementTagObj
   ,StyleTagObject:TW3CustomControl.StyleTagObject
   ,ChildAdded:TW3Component.ChildAdded
   ,Create$18:TW3CustomControl.Create$18
   ,GetHeight:TW3MovableControl.GetHeight
   ,GetWidth:TW3MovableControl.GetWidth
   ,Resize$:function($){return $.ClassType.Resize($)}
   ,SetHeight:TW3MovableControl.SetHeight
   ,SetWidth:TW3MovableControl.SetWidth
   ,supportAdjustment:TW3MovableControl.supportAdjustment
   ,CBClick:TW3CustomControl.CBClick
   ,CBKeyDown:TW3CustomControl.CBKeyDown
   ,CBKeyUp:TW3CustomControl.CBKeyUp
   ,CBMouseDown:TW3CustomControl.CBMouseDown
   ,CBMouseMove:TW3CustomControl.CBMouseMove
   ,CBMouseUp:TW3CustomControl.CBMouseUp
   ,GetEnabled:TW3CustomControl.GetEnabled
   ,Invalidate:TW3CustomControl.Invalidate
   ,SetEnabled:TW3CustomControl.SetEnabled
};
/// TW3Display = class (TW3CustomControl)
///  [line: 57, column: 3, file: SmartCL.Application]
var TW3Display = {
   $ClassName:"TW3Display",
   $Parent:TW3CustomControl
   ,$Init:function ($) {
      TW3CustomControl.$Init($);
      $.FFooter = $.FHeader = $.FOnOrient = $.FView = null;
   }
   /// procedure TW3Display.FinalizeObject()
   ///  [line: 397, column: 22, file: SmartCL.Application]
   ,FinalizeObject:function(Self) {
      TObject.Free(Self.FView);
      if (Self.FHeader) {
         TObject.Free(Self.FHeader);
      }
      if (Self.FFooter) {
         TObject.Free(Self.FFooter);
      }
      TW3CustomControl.FinalizeObject(Self);
   }
   /// function TW3Display.GetHeightOfChildren() : Integer
   ///  [line: 418, column: 21, file: SmartCL.Application]
   ,GetHeightOfChildren:function(Self) {
      var Result = 0;
      var x$10 = 0;
      var mObj$5 = null;
      var $temp12;
      for(x$10 = 0,$temp12 = TW3Component.GetChildCount(Self);x$10<$temp12;x$10++) {
         mObj$5 = TW3Component.GetChildObject(Self,x$10);
         if (((mObj$5!==Self.FView)&&$Is(mObj$5,TW3CustomControl))&&(!$Is(mObj$5,TW3BlockBox))) {
            (Result+= TW3MovableControl.GetHeight$($As(mObj$5,TW3CustomControl)));
         }
      }
      return Result
   }
   /// procedure TW3Display.InitializeObject()
   ///  [line: 390, column: 22, file: SmartCL.Application]
   ,InitializeObject:function(Self) {
      TW3CustomControl.InitializeObject(Self);
      Self.FView = TW3Component.Create$18$($New(TW3DisplayView),Self);
      TW3MovableControl.SetTop(Self.FView,5);
   }
   /// procedure TW3Display.PositionFormInView(aForm: TW3CustomForm)
   ///  [line: 462, column: 22, file: SmartCL.Application]
   ,PositionFormInView:function(Self, aForm) {
      var mApp = null;
      var dx$2 = 0;
      var dy$2 = 0;
      if (aForm) {
         mApp = Application();
         if ((mApp!==null)&&(!mApp.FTerminated)) {
            dx$2 = TW3ScrollInfo.GetScrollLeft(TW3CustomControl.GetScrollInfo(Self.FView));
            dy$2 = TW3ScrollInfo.GetScrollTop(TW3CustomControl.GetScrollInfo(Self.FView));
            TW3MovableControl.SetBounds$2(aForm,dx$2,dy$2,TW3MovableControl.GetWidth$(Self.FView),TW3MovableControl.GetHeight$(Self.FView));
         }
      } else {
         throw EW3Exception.CreateFmt($New(EW3Screen),$R[0],["PositionFormInView", TObject.ClassName(Self.ClassType), "Form parameter was NIL error"]);
      }
   }
   /// procedure TW3Display.ReSize()
   ///  [line: 431, column: 22, file: SmartCL.Application]
   ,Resize:function(Self) {
      var mTotal = 0;
      var mList = [];
      var x$11 = 0;
      var dy$3 = 0;
      var mObj$6 = null;
      TW3MovableControl.Resize(Self);
      mTotal = TW3Display.GetHeightOfChildren(Self);
      TW3MovableControl.SetHeight$(Self.FView,TW3MovableControl.GetHeight$(Self)-mTotal);
      mList = TW3CustomControl.GetChildrenSortedByYPos(Self);
      dy$3 = 0;
      var $temp13;
      for(x$11 = 0,$temp13 = mList.length;x$11<$temp13;x$11++) {
         mObj$6 = $As(mList[x$11],TW3CustomControl);
         if (!$Is(mObj$6,TW3BlockBox)) {
            TW3MovableControl.SetBounds$2(mObj$6,0,dy$3,TW3MovableControl.GetWidth$(Self),TW3MovableControl.GetHeight$(mObj$6));
            (dy$3+= TW3MovableControl.GetHeight$(mObj$6));
            if (x$11==0) {
               (dy$3+= 2);
            }
         } else {
            TW3MovableControl.SetBounds$2(mObj$6,0,0,TW3MovableControl.GetWidth$(Self),TW3MovableControl.GetHeight$(Self));
         }
      }
   }
   ,Destroy:TW3TagObj.Destroy
   ,AfterUpdate:TW3CustomControl.AfterUpdate
   ,FinalizeObject$:function($){return $.ClassType.FinalizeObject($)}
   ,InitializeObject$:function($){return $.ClassType.InitializeObject($)}
   ,MakeElementTagId:TW3TagObj.MakeElementTagId
   ,MakeElementTagObj:TW3TagObj.MakeElementTagObj
   ,StyleTagObject:TW3CustomControl.StyleTagObject
   ,ChildAdded:TW3Component.ChildAdded
   ,Create$18:TW3CustomControl.Create$18
   ,GetHeight:TW3MovableControl.GetHeight
   ,GetWidth:TW3MovableControl.GetWidth
   ,Resize$:function($){return $.ClassType.Resize($)}
   ,SetHeight:TW3MovableControl.SetHeight
   ,SetWidth:TW3MovableControl.SetWidth
   ,supportAdjustment:TW3MovableControl.supportAdjustment
   ,CBClick:TW3CustomControl.CBClick
   ,CBKeyDown:TW3CustomControl.CBKeyDown
   ,CBKeyUp:TW3CustomControl.CBKeyUp
   ,CBMouseDown:TW3CustomControl.CBMouseDown
   ,CBMouseMove:TW3CustomControl.CBMouseMove
   ,CBMouseUp:TW3CustomControl.CBMouseUp
   ,GetEnabled:TW3CustomControl.GetEnabled
   ,Invalidate:TW3CustomControl.Invalidate
   ,SetEnabled:TW3CustomControl.SetEnabled
};
/// TW3CustomApplication = class (TObject)
///  [line: 216, column: 3, file: SmartCL.Application]
var TW3CustomApplication = {
   $ClassName:"TW3CustomApplication",
   $Parent:TObject
   ,$Init:function ($) {
      TObject.$Init($);
      $.FBody = $.FCurrentForm = $.FDisplay = $.FEnterAnim = $.FLeaveAnim = $.FMainForm = $.FOnBeforeUnload = $.FOnUnload = $.FTransDst = $.FTransSrc = null;
      $.FEntryEffect = 0;
      $.FFormChangeActive = $.FTerminated = false;
      $.FForms = [];
   }
   /// procedure TW3CustomApplication.AdjustScreen()
   ///  [line: 757, column: 32, file: SmartCL.Application]
   ,AdjustScreen:function(Self) {
      TW3ScrollInfo.ScrollTo(TW3CustomControl.GetScrollInfo(Self.FDisplay),0,0);
      TW3MovableControl.SetBounds$2(Self.FDisplay,0,0,TDocumentBody.GetWidth$5(Self.FBody),TDocumentBody.GetHeight$5(Self.FBody));
   }
   /// procedure TW3CustomApplication.ApplicationClosing()
   ///  [line: 792, column: 32, file: SmartCL.Application]
   ,ApplicationClosing:function(Self) {
   }
   /// procedure TW3CustomApplication.ApplicationStarted()
   ///  [line: 782, column: 32, file: SmartCL.Application]
   ,ApplicationStarted:function(Self) {
   }
   /// procedure TW3CustomApplication.ApplicationStarting()
   ///  [line: 787, column: 32, file: SmartCL.Application]
   ,ApplicationStarting:function(Self) {
      TW3CustomApplication.AdjustScreen(Self);
   }
   /// procedure TW3CustomApplication.CBOnBeforeUnload()
   ///  [line: 709, column: 32, file: SmartCL.Application]
   ,CBOnBeforeUnload:function(Self) {
      if (Self.FOnBeforeUnload) {
         Self.FOnBeforeUnload(Self);
      }
   }
   /// procedure TW3CustomApplication.CBOnOrientationChange()
   ///  [line: 731, column: 32, file: SmartCL.Application]
   ,CBOnOrientationChange:function(Self) {
      var mOrientation = 0;
      var mTemp$1 = 0;
      var mEntry = null;
      mTemp$1 = parseInt(window.orientation,10);
      switch (mTemp$1) {
         case 0 :
            mOrientation = 0;
            break;
         case 90 :
            mOrientation = 1;
            break;
         case (-90) :
            mOrientation = 2;
            break;
         case 180 :
            mOrientation = 3;
            break;
      }
      try {
         if (Self.FDisplay) {
            mEntry = Self.FDisplay.FOnOrient;
            if (mEntry) {
               mEntry(Self.FDisplay,mOrientation,mTemp$1);
            }
         }
      } finally {
         TW3CustomApplication.AdjustScreen(Self);
      }
   }
   /// procedure TW3CustomApplication.CBOnReSize()
   ///  [line: 726, column: 32, file: SmartCL.Application]
   ,CBOnReSize:function(Self) {
      TW3CustomApplication.AdjustScreen(Self);
   }
   /// procedure TW3CustomApplication.CBOnUnLoad()
   ///  [line: 715, column: 32, file: SmartCL.Application]
   ,CBOnUnLoad:function(Self) {
      try {
         if (Self.FOnUnload) {
            Self.FOnUnload(Self);
         }
      } finally {
         if (!Self.FTerminated) {
            TW3CustomApplication.Terminate(Self);
         }
      }
   }
   /// constructor TW3CustomApplication.Create()
   ///  [line: 487, column: 34, file: SmartCL.Application]
   ,Create$20:function(Self) {
      TObject.Create(Self);
      Self.FBody = TW3Component.Create$18$($New(TDocumentBody),null);
      Self.FDisplay = TW3Component.Create$18$($New(TW3Display),Self.FBody);
      if (!Instance) {
         Instance = Self;
      }
      return Self
   }
   /// function TW3CustomApplication.CreateForm(aForm: TW3CustomFormClass; isMainForm: Boolean = False) : TW3CustomForm
   ///  [line: 823, column: 31, file: SmartCL.Application]
   ,CreateForm:function(Self, aForm$1, isMainForm) {
      var Result = null;
      Result = TW3Component.Create$18$($NewDyn(aForm$1," in TW3CustomApplication.CreateForm [line: 825, column: 19, file: SmartCL.Application]"),Self.FDisplay.FView);
      TW3CustomApplication.RegisterFormInstance(Self,Result,isMainForm);
      return Result
   }
   /// destructor TW3CustomApplication.Destroy()
   ///  [line: 498, column: 33, file: SmartCL.Application]
   ,Destroy:function(Self) {
      if (!Self.FTerminated) {
         TW3CustomApplication.Terminate(Self);
      }
      TObject.Free(Self.FDisplay);
      TObject.Free(Self.FBody);
      Instance = null;
      TObject.Destroy(Self);
   }
   /// procedure TW3CustomApplication.GotoFormByRef(aForm: TW3CustomForm; Effect: TFormEntryEffect = 0)
   ///  [line: 962, column: 32, file: SmartCL.Application]
   ,GotoFormByRef:function(Self, aForm$2, Effect) {
      var mIndex$1 = 0;
      if (Self.FTerminated) {
         return;
      }
      if (Self.FFormChangeActive) {
         throw EW3Exception.CreateFmt($New(EW3Application),$R[0],["TW3CustomApplication.GotoFormByRef", TObject.ClassName(Self.ClassType), "A form transition is already active error"]);
      }
      if (aForm$2===null) {
         throw EW3Exception.CreateFmt($New(EW3Application),$R[0],["TW3CustomApplication.GotoFormByRef", TObject.ClassName(Self.ClassType), "Form parameter is NIL error"]);
      }
      mIndex$1 = Self.FForms.indexOf(aForm$2);
      if (mIndex$1<0) {
         throw EW3Exception.CreateFmt($New(EW3Application),$R[0],["TW3CustomApplication.GotoFormByRef", TObject.ClassName(Self.ClassType), "Form not registered error"]);
      }
      if (aForm$2===Self.FCurrentForm) {
         return;
      }
      if (Self.FCurrentForm===null) {
         Self.FCurrentForm = aForm$2;
         TW3Display.PositionFormInView(Self.FDisplay,aForm$2);
         TW3MovableControl.SetVisible(aForm$2,true);
         TW3CustomForm.FormActivated(aForm$2);
         return;
      }
      if (Effect==0) {
         TW3CustomForm.FormDeactivated(Self.FCurrentForm);
         TW3MovableControl.SetVisible(Self.FCurrentForm,false);
         TW3MovableControl.SetVisible(aForm$2,true);
         TW3Display.PositionFormInView(Self.FDisplay,aForm$2);
         TW3CustomForm.FormActivated(aForm$2);
         Self.FCurrentForm = aForm$2;
         return;
      }
      Self.FFormChangeActive = true;
      Self.FEntryEffect = Effect;
      TW3CustomControl.BringToFront(aForm$2);
      TW3CustomForm.FormDeactivated(Self.FCurrentForm);
      Self.FTransSrc = Self.FCurrentForm;
      Self.FTransDst = aForm$2;
      TW3MovableControl.SetVisible(aForm$2,true);
      TW3Display.PositionFormInView(Self.FDisplay,aForm$2);
      if ((Self.FEnterAnim===null)||(Self.FLeaveAnim===null)) {
         Self.FEnterAnim = TW3CustomAnimation.Create$42$($New(TW3NamedAnimation));
         TW3CustomAnimation.SetDuration(Self.FEnterAnim,0.3);
         Self.FLeaveAnim = TW3CustomAnimation.Create$42$($New(TW3NamedAnimation));
         TW3CustomAnimation.SetDuration(Self.FLeaveAnim,0.3);
      }
      switch (Effect) {
         case 1 :
            Self.FEnterAnim.FName$2 = "MOVE-LEFT";
            Self.FLeaveAnim.FName$2 = "MOVE-OUT-LEFT";
            break;
         case 2 :
            Self.FEnterAnim.FName$2 = "MOVE-RIGHT";
            Self.FLeaveAnim.FName$2 = "MOVE-OUT-RIGHT";
            break;
      }
      TW3CustomAnimation.ExecuteEx(Self.FEnterAnim,aForm$2,null,$Event1(Self,TW3CustomApplication.HandleEnterAnimEnds));
      TW3CustomAnimation.ExecuteEx(Self.FLeaveAnim,Self.FCurrentForm,null,$Event1(Self,TW3CustomApplication.HandleLeaveAnimEnds));
   }
   /// procedure TW3CustomApplication.HandleEnterAnimEnds(Sender: TObject)
   ///  [line: 923, column: 32, file: SmartCL.Application]
   ,HandleEnterAnimEnds:function(Self, Sender) {
      var mAnim = null;
      mAnim = $As(Sender,TW3NamedAnimation);
      switch (Self.FEntryEffect) {
         case 1 :
            TW3MovableControl.MoveTo(Self.FTransDst,0,0);
            Self.FCurrentForm = Self.FTransDst;
            TW3CustomForm.FormActivated(Self.FCurrentForm);
            Self.FFormChangeActive = false;
            break;
         case 2 :
            TW3MovableControl.MoveTo(Self.FTransDst,0,0);
            Self.FCurrentForm = Self.FTransDst;
            TW3CustomForm.FormActivated(Self.FCurrentForm);
            TW3MovableControl.SetVisible(Self.FTransSrc,false);
            TW3Display.PositionFormInView(Self.FDisplay,Self.FTransSrc);
            Self.FFormChangeActive = false;
            break;
      }
      TObject.Free(mAnim);
      mAnim = null;
   }
   /// procedure TW3CustomApplication.HandleLeaveAnimEnds(Sender: TObject)
   ///  [line: 914, column: 32, file: SmartCL.Application]
   ,HandleLeaveAnimEnds:function(Self, Sender$1) {
      var mAnim$1 = null;
      mAnim$1 = $As(Sender$1,TW3NamedAnimation);
      TW3MovableControl.SetVisible(Self.FTransSrc,false);
      TObject.Free(mAnim$1);
   }
   /// procedure TW3CustomApplication.HookWindowEvents()
   ///  [line: 520, column: 32, file: SmartCL.Application]
   ,HookWindowEvents:function(Self) {
      w3_bind2(document.body,"onunload",$Event0(Self,TW3CustomApplication.CBOnUnLoad));
      w3_bind2(document.body,"onbeforeunload",$Event0(Self,TW3CustomApplication.CBOnBeforeUnload));
      w3_bind2(window,"onresize",$Event0(Self,TW3CustomApplication.CBOnReSize));
      w3_bind2(window,"onorientationchange",$Event0(Self,TW3CustomApplication.CBOnOrientationChange));
   }
   /// procedure TW3CustomApplication.RegisterFormInstance(aForm: TW3CustomForm; isMainForm: Boolean = False)
   ///  [line: 829, column: 32, file: SmartCL.Application]
   ,RegisterFormInstance:function(Self, aForm$3, isMainForm$1) {
      if (Self.FTerminated) {
         return;
      }
      if (aForm$3) {
         if (Self.FForms.indexOf(aForm$3)<0) {
            try {
               Self.FForms.push(aForm$3);
            } catch ($e) {
               var e$4 = $W($e);
               throw EW3Exception.CreateFmt($New(EW3Exception),$R[0],["TW3CustomApplication.RegisterFormInstance", TObject.ClassName(Self.ClassType), e$4.FMessage]);
            }
            w3_RequestAnimationFrame(function () {
               TW3MovableControl.AdjustToParentBox(aForm$3);
            });
            if (isMainForm$1) {
               Self.FMainForm = aForm$3;
            } else {
               TW3MovableControl.SetVisible(aForm$3,false);
            }
         } else {
            throw EW3Exception.CreateFmt($New(EW3Application),$R[0],["TW3CustomApplication.RegisterFormInstance", TObject.ClassName(Self.ClassType), "Form already registered"]);
         }
      } else {
         throw EW3Exception.CreateFmt($New(EW3Application),$R[0],["TW3CustomApplication.RegisterFormInstance", TObject.ClassName(Self.ClassType), "Form parameter is NIL error"]);
      }
   }
   /// procedure TW3CustomApplication.RunApp()
   ///  [line: 797, column: 32, file: SmartCL.Application]
   ,RunApp:function(Self) {
      var FTemp = null;
      TW3CustomApplication.HookWindowEvents(Self);
      TW3CustomApplication.ApplicationStarting(Self);
      TApplicationFormsList.AutoCreateForms(FormsFactory(),Self.FDisplay.FView);
      if (Self.FMainForm) {
         FTemp = Self.FMainForm;
         Self.FMainForm = null;
         TW3CustomApplication.GotoFormByRef(Self,FTemp,0);
      }
      TW3CustomApplication.ApplicationStarted(Self);
   }
   /// procedure TW3CustomApplication.Terminate()
   ///  [line: 763, column: 32, file: SmartCL.Application]
   ,Terminate:function(Self) {
      var x$12 = 0;
      if (Self.FTerminated) {
         return;
      }
      Self.FTerminated = true;
      TW3CustomApplication.ApplicationClosing(Self);
      try {
         var $temp14;
         for(x$12 = 0,$temp14 = Self.FForms.length;x$12<$temp14;x$12++) {
            TObject.Free(Self.FForms[x$12]);
            Self.FForms[x$12]=null;
         }
         Self.FForms.length=0;
      } finally {
         TObject.Free(Self);
      }
   }
   /// procedure TW3CustomApplication.UnRegisterFormInstance(aForm: TW3CustomForm)
   ///  [line: 871, column: 32, file: SmartCL.Application]
   ,UnRegisterFormInstance:function(Self, aForm$4) {
      var mIndex$2 = 0;
      if (!Self.FTerminated) {
         if (aForm$4) {
            mIndex$2 = Self.FForms.indexOf(aForm$4);
            if (mIndex$2>=0) {
               if (Self.FMainForm!==aForm$4) {
                  if (Self.FCurrentForm===aForm$4) {
                     TW3CustomApplication.GotoFormByRef(Self,Self.FMainForm,0);
                  }
                  Self.FForms.splice(mIndex$2,1)
                  ;
                  try {
                     TObject.Free(aForm$4);
                  } catch ($e) {
                     var e$5 = $W($e);
                     throw EW3Exception.CreateFmt($New(EW3Application),$R[0],["TW3CustomApplication.UnRegisterFormInstance", TObject.ClassName(Self.ClassType), e$5.FMessage]);
                  }
               } else {
                  throw EW3Exception.CreateFmt($New(EW3Application),$R[0],["TW3CustomApplication.UnRegisterFormInstance", TObject.ClassName(Self.ClassType), "Main form cannot be removed error"]);
               }
            } else {
               throw EW3Exception.CreateFmt($New(EW3Application),$R[0],["TW3CustomApplication.UnRegisterFormInstance", TObject.ClassName(Self.ClassType), "Form is not registered"]);
            }
         } else {
            throw EW3Exception.CreateFmt($New(EW3Application),$R[0],["TW3CustomApplication.UnRegisterFormInstance", TObject.ClassName(Self.ClassType), "Form parameter is NIL error"]);
         }
      }
   }
   ,Destroy$:function($){return $.ClassType.Destroy($)}
};
/// TW3BlockBox = class (TW3CustomControl)
///  [line: 38, column: 3, file: SmartCL.Application]
var TW3BlockBox = {
   $ClassName:"TW3BlockBox",
   $Parent:TW3CustomControl
   ,$Init:function ($) {
      TW3CustomControl.$Init($);
   }
   ,Destroy:TW3TagObj.Destroy
   ,AfterUpdate:TW3CustomControl.AfterUpdate
   ,FinalizeObject:TW3CustomControl.FinalizeObject
   ,InitializeObject:TW3CustomControl.InitializeObject
   ,MakeElementTagId:TW3TagObj.MakeElementTagId
   ,MakeElementTagObj:TW3TagObj.MakeElementTagObj
   ,StyleTagObject:TW3CustomControl.StyleTagObject
   ,ChildAdded:TW3Component.ChildAdded
   ,Create$18:TW3CustomControl.Create$18
   ,GetHeight:TW3MovableControl.GetHeight
   ,GetWidth:TW3MovableControl.GetWidth
   ,Resize:TW3MovableControl.Resize
   ,SetHeight:TW3MovableControl.SetHeight
   ,SetWidth:TW3MovableControl.SetWidth
   ,supportAdjustment:TW3MovableControl.supportAdjustment
   ,CBClick:TW3CustomControl.CBClick
   ,CBKeyDown:TW3CustomControl.CBKeyDown
   ,CBKeyUp:TW3CustomControl.CBKeyUp
   ,CBMouseDown:TW3CustomControl.CBMouseDown
   ,CBMouseMove:TW3CustomControl.CBMouseMove
   ,CBMouseUp:TW3CustomControl.CBMouseUp
   ,GetEnabled:TW3CustomControl.GetEnabled
   ,Invalidate:TW3CustomControl.Invalidate
   ,SetEnabled:TW3CustomControl.SetEnabled
};
/// TModalResult enumeration
///  [line: 82, column: 3, file: SmartCL.Application]
var TModalResult = [ "mrCancel", "mrOK" ];
/// TFormEntryEffect enumeration
///  [line: 30, column: 3, file: SmartCL.Application]
var TFormEntryEffect = [ "feNone", "feFromRight", "feToLeft" ];
/// TDisplayOrientation enumeration
///  [line: 32, column: 3, file: SmartCL.Application]
var TDisplayOrientation = [ "soPortrait", "soLandscapeLeft", "soLandscapeRight", "soFlipped" ];
/// TApplicationFormsList = class (TObject)
///  [line: 174, column: 3, file: SmartCL.Application]
var TApplicationFormsList = {
   $ClassName:"TApplicationFormsList",
   $Parent:TObject
   ,$Init:function ($) {
      TObject.$Init($);
      $.FFormOwner = null;
      $.FList = [];
      $.FNextAutoCreate = 0;
   }
   /// procedure TApplicationFormsList.AutoCreateForm(aFormInfo: TApplicationFormInfo)
   ///  [line: 1052, column: 33, file: SmartCL.Application]
   ,AutoCreateForm:function(Self, aFormInfo) {
      if (!aFormInfo.a$6) {
         aFormInfo.a$6 = TW3Component.Create$18$($NewDyn(aFormInfo.a$4," in TApplicationFormsList.AutoCreateForm [line: 1056, column: 47, file: SmartCL.Application]"),Self.FFormOwner);
         TW3CustomApplication.RegisterFormInstance(Application(),aFormInfo.a$6,aFormInfo.a$8);
      }
      aFormInfo.a$9 = true;
   }
   /// procedure TApplicationFormsList.AutoCreateForms(owner: TW3Component)
   ///  [line: 1062, column: 33, file: SmartCL.Application]
   ,AutoCreateForms:function(Self, owner) {
      var a$55 = 0;
      var info = null;
      var a$56 = [];
      Self.FFormOwner = owner;
      Self.FNextAutoCreate = 0;
      a$56 = Self.FList;
      var $temp15;
      for(a$55 = 0,$temp15 = a$56.length;a$55<$temp15;a$55++) {
         info = a$56[a$55];
         TApplicationFormsList.AutoCreateForm(Self,info);
         ++Self.FNextAutoCreate;
         if (info.a$8) {
            break;
         }
      }
      setTimeout($Event0(Self,TApplicationFormsList.AutoCreateNextForm),50);
   }
   /// procedure TApplicationFormsList.AutoCreateNextForm()
   ///  [line: 1077, column: 33, file: SmartCL.Application]
   ,AutoCreateNextForm:function(Self) {
      var iForm = 0;
      var info$1 = null;
      var $temp16;
      for(iForm = Self.FNextAutoCreate,$temp16 = Self.FList.length;iForm<$temp16;iForm++) {
         info$1 = Self.FList[iForm];
         if ((info$1.a$5&&(!(info$1.a$6!==null)))&&(!info$1.a$9)) {
            TApplicationFormsList.AutoCreateForm(Self,info$1);
            ++Self.FNextAutoCreate;
            if (Self.FNextAutoCreate<(Self.FList.length-1)) {
               setTimeout($Event0(Self,TApplicationFormsList.AutoCreateNextForm),50);
            }
            break;
         }
      }
   }
   /// function TApplicationFormsList.IndexOfFormClass(aFormClass: TW3CustomFormClass) : Integer
   ///  [line: 1111, column: 32, file: SmartCL.Application]
   ,IndexOfFormClass:function(Self, aFormClass) {
      var Result = 0;
      var $temp17;
      for(Result = 0,$temp17 = Self.FList.length;Result<$temp17;Result++) {
         if (Self.FList[Result].a$4==aFormClass) {
            return Result;
         }
      }
      Result = -1;
      return Result
   }
   /// procedure TApplicationFormsList.RegisterFormInstance(aFormClass: TW3CustomFormClass; aFormInstance: TW3CustomForm)
   ///  [line: 1158, column: 33, file: SmartCL.Application]
   ,RegisterFormInstance$1:function(Self, aFormClass$1, aFormInstance) {
      var formInfo = null;
      var idx = 0;
      idx = TApplicationFormsList.IndexOfFormClass(Self,aFormClass$1);
      if (idx>=0) {
         formInfo = Self.FList[idx];
      } else {
         formInfo = TObject.Create($New(TApplicationFormInfo));
         formInfo.a$4 = aFormClass$1;
         Self.FList.push(formInfo);
      }
      formInfo.a$6 = aFormInstance;
      formInfo.a$9 = true;
   }
   /// procedure TApplicationFormsList.UnregisterFormInstance(aFormInstance: TW3CustomForm)
   ///  [line: 1174, column: 33, file: SmartCL.Application]
   ,UnregisterFormInstance:function(Self, aFormInstance$1) {
      var i$1 = 0;
      var $temp18;
      for(i$1 = 0,$temp18 = Self.FList.length;i$1<$temp18;i$1++) {
         if (Self.FList[i$1].a$6===aFormInstance$1) {
            Self.FList[i$1].a$6 = null;
         }
      }
   }
   ,Destroy:TObject.Destroy
};
/// TApplicationFormInfo = class (TObject)
///  [line: 164, column: 3, file: SmartCL.Application]
var TApplicationFormInfo = {
   $ClassName:"TApplicationFormInfo",
   $Parent:TObject
   ,$Init:function ($) {
      TObject.$Init($);
      $.a$9 = $.a$8 = $.a$5 = false;
      $.a$6 = null;
      $.a$4 = null;
   }
   ,Destroy:TObject.Destroy
};
function Forms$2() {
   var Result = null;
   Result = FormsFactory();
   return Result
};
/// EW3Screen = class (EW3Exception)
///  [line: 27, column: 3, file: SmartCL.Application]
var EW3Screen = {
   $ClassName:"EW3Screen",
   $Parent:EW3Exception
   ,$Init:function ($) {
      EW3Exception.$Init($);
   }
   ,Destroy:Exception.Destroy
};
/// EW3Application = class (EW3Exception)
///  [line: 28, column: 3, file: SmartCL.Application]
var EW3Application = {
   $ClassName:"EW3Application",
   $Parent:EW3Exception
   ,$Init:function ($) {
      EW3Exception.$Init($);
   }
   ,Destroy:Exception.Destroy
};
function Application() {
   var Result = null;
   Result = Instance;
   return Result
};
/// TModalInfo = class (TObject)
///  [line: 207, column: 3, file: SmartCL.Application]
var TModalInfo = {
   $ClassName:"TModalInfo",
   $Parent:TObject
   ,$Init:function ($) {
      TObject.$Init($);
      $.OnOK = null;
      $.OnCancel = null;
      $.ModalForm = $.ModalPanel = $.OwnerForm = $.OpaqueMask = null;
   }
   ,Destroy:TObject.Destroy
};
function FormsFactory() {
   var Result = null;
   if (!GForms) {
      GForms = TObject.Create($New(TApplicationFormsList));
   }
   Result = GForms;
   return Result
};
/// TW3CustomForm = class (TW3CustomControl)
///  [line: 23, column: 3, file: SmartCL.Forms]
var TW3CustomForm = {
   $ClassName:"TW3CustomForm",
   $Parent:TW3CustomControl
   ,$Init:function ($) {
      TW3CustomControl.$Init($);
      $.FCaption = "";
      $.FInitialized = false;
   }
   /// constructor TW3CustomForm.Create(AOwner: TW3Component)
   ///  [line: 56, column: 27, file: SmartCL.Forms]
   ,Create$18:function(Self, AOwner$3) {
      TW3CustomControl.Create$18(Self,AOwner$3);
      TApplicationFormsList.RegisterFormInstance$1(Forms$2(),$AsClass(TObject.ClassType(Self.ClassType),TW3CustomForm),Self);
      return Self
   }
   /// destructor TW3CustomForm.Destroy()
   ///  [line: 62, column: 26, file: SmartCL.Forms]
   ,Destroy:function(Self) {
      TW3CustomApplication.UnRegisterFormInstance(Application(),Self);
      TApplicationFormsList.UnregisterFormInstance(Forms$2(),Self);
   }
   /// procedure TW3CustomForm.FormActivated()
   ///  [line: 86, column: 25, file: SmartCL.Forms]
   ,FormActivated:function(Self) {
      var x$13 = 0;
      var mObj$7 = null;
      var mControl = null;
      if (!Self.FInitialized) {
         Self.FInitialized = true;
         TW3CustomForm.InitializeForm(Self);
      }
      if (Self.FObjReady) {
         var $temp19;
         for(x$13 = 0,$temp19 = TW3Component.GetChildCount(Self);x$13<$temp19;x$13++) {
            mObj$7 = TW3Component.GetChildObject(Self,x$13);
            if ($Is(mObj$7,TW3CustomControl)) {
               mControl = $As(mObj$7,TW3CustomControl);
               if (mControl.FObjReady&&TW3MovableControl.GetVisible(mControl)) {
                  TW3CustomControl.LayoutChildren(mControl);
               }
            }
         }
      }
   }
   /// procedure TW3CustomForm.FormDeactivated()
   ///  [line: 111, column: 25, file: SmartCL.Forms]
   ,FormDeactivated:function(Self) {
   }
   /// procedure TW3CustomForm.InitializeForm()
   ///  [line: 76, column: 25, file: SmartCL.Forms]
   ,InitializeForm:function(Self) {
   }
   /// procedure TW3CustomForm.setCaption(Value: String)
   ///  [line: 81, column: 25, file: SmartCL.Forms]
   ,setCaption:function(Self, Value$7) {
      Self.FCaption = Value$7;
   }
   /// procedure TW3CustomForm.StyleTagObject()
   ///  [line: 68, column: 25, file: SmartCL.Forms]
   ,StyleTagObject:function(Self) {
      TW3CustomControl.StyleTagObject(Self);
      w3_setStyle(Self.FHandle,w3_CSSPrefix("Transform"),"none");
      TW3CustomControl.SetStyleClass(Self,"TW3CustomForm");
   }
   ,Destroy$:function($){return $.ClassType.Destroy($)}
   ,AfterUpdate:TW3CustomControl.AfterUpdate
   ,FinalizeObject:TW3CustomControl.FinalizeObject
   ,InitializeObject:TW3CustomControl.InitializeObject
   ,MakeElementTagId:TW3TagObj.MakeElementTagId
   ,MakeElementTagObj:TW3TagObj.MakeElementTagObj
   ,StyleTagObject$:function($){return $.ClassType.StyleTagObject($)}
   ,ChildAdded:TW3Component.ChildAdded
   ,Create$18$:function($){return $.ClassType.Create$18.apply($.ClassType, arguments)}
   ,GetHeight:TW3MovableControl.GetHeight
   ,GetWidth:TW3MovableControl.GetWidth
   ,Resize:TW3MovableControl.Resize
   ,SetHeight:TW3MovableControl.SetHeight
   ,SetWidth:TW3MovableControl.SetWidth
   ,supportAdjustment:TW3MovableControl.supportAdjustment
   ,CBClick:TW3CustomControl.CBClick
   ,CBKeyDown:TW3CustomControl.CBKeyDown
   ,CBKeyUp:TW3CustomControl.CBKeyUp
   ,CBMouseDown:TW3CustomControl.CBMouseDown
   ,CBMouseMove:TW3CustomControl.CBMouseMove
   ,CBMouseUp:TW3CustomControl.CBMouseUp
   ,GetEnabled:TW3CustomControl.GetEnabled
   ,Invalidate:TW3CustomControl.Invalidate
   ,SetEnabled:TW3CustomControl.SetEnabled
};
/// TW3Form = class (TW3CustomForm)
///  [line: 43, column: 3, file: SmartCL.Forms]
var TW3Form = {
   $ClassName:"TW3Form",
   $Parent:TW3CustomForm
   ,$Init:function ($) {
      TW3CustomForm.$Init($);
   }
   ,Destroy:TW3CustomForm.Destroy
   ,AfterUpdate:TW3CustomControl.AfterUpdate
   ,FinalizeObject:TW3CustomControl.FinalizeObject
   ,InitializeObject:TW3CustomControl.InitializeObject
   ,MakeElementTagId:TW3TagObj.MakeElementTagId
   ,MakeElementTagObj:TW3TagObj.MakeElementTagObj
   ,StyleTagObject:TW3CustomForm.StyleTagObject
   ,ChildAdded:TW3Component.ChildAdded
   ,Create$18:TW3CustomForm.Create$18
   ,GetHeight:TW3MovableControl.GetHeight
   ,GetWidth:TW3MovableControl.GetWidth
   ,Resize:TW3MovableControl.Resize
   ,SetHeight:TW3MovableControl.SetHeight
   ,SetWidth:TW3MovableControl.SetWidth
   ,supportAdjustment:TW3MovableControl.supportAdjustment
   ,CBClick:TW3CustomControl.CBClick
   ,CBKeyDown:TW3CustomControl.CBKeyDown
   ,CBKeyUp:TW3CustomControl.CBKeyUp
   ,CBMouseDown:TW3CustomControl.CBMouseDown
   ,CBMouseMove:TW3CustomControl.CBMouseMove
   ,CBMouseUp:TW3CustomControl.CBMouseUp
   ,GetEnabled:TW3CustomControl.GetEnabled
   ,Invalidate:TW3CustomControl.Invalidate
   ,SetEnabled:TW3CustomControl.SetEnabled
};
/// TW3ScrollInfo = class (TW3OwnedObject)
///  [line: 276, column: 3, file: SmartCL.Components]
var TW3ScrollInfo = {
   $ClassName:"TW3ScrollInfo",
   $Parent:TW3OwnedObject
   ,$Init:function ($) {
      TW3OwnedObject.$Init($);
   }
   /// function TW3ScrollInfo.AcceptParent(aObject: TObject) : Boolean
   ///  [line: 1356, column: 24, file: SmartCL.Components]
   ,AcceptParent:function(Self, aObject$1) {
      var Result = false;
      Result = (aObject$1!==null)&&$Is(aObject$1,TW3TagObj);
      return Result
   }
   /// function TW3ScrollInfo.GetScrollHeight() : Integer
   ///  [line: 1402, column: 24, file: SmartCL.Components]
   ,GetScrollHeight:function(Self) {
      var Result = 0;
      var mRef = undefined;
      mRef = $As(Self.FOwner,TW3TagObj).FHandle;
      if (mRef) {
         Result = TVariant.AsInteger(mRef.scrollHeight);
      } else {
         EW3TagObj.RaiseCntErrMethod("TW3ScrollInfo.GetScrollHeight",Self,"invalid owner handle error");
      }
      return Result
   }
   /// function TW3ScrollInfo.GetScrollLeft() : Integer
   ///  [line: 1412, column: 24, file: SmartCL.Components]
   ,GetScrollLeft:function(Self) {
      var Result = 0;
      var mRef$1 = undefined;
      mRef$1 = $As(Self.FOwner,TW3TagObj).FHandle;
      if (mRef$1) {
         Result = TVariant.AsInteger(mRef$1.scrollLeft);
      } else {
         EW3TagObj.RaiseCntErrMethod("TW3ScrollInfo.GetScrollLeft",Self,"invalid owner handle error");
      }
      return Result
   }
   /// function TW3ScrollInfo.GetScrollTop() : Integer
   ///  [line: 1422, column: 24, file: SmartCL.Components]
   ,GetScrollTop:function(Self) {
      var Result = 0;
      var mRef$2 = undefined;
      mRef$2 = $As(Self.FOwner,TW3TagObj).FHandle;
      if (mRef$2) {
         Result = TVariant.AsInteger(mRef$2.scrollTop);
      } else {
         EW3TagObj.RaiseCntErrMethod("TW3ScrollInfo.GetScrollTop",Self,"invalid owner handle error");
      }
      return Result
   }
   /// function TW3ScrollInfo.GetScrollWidth() : Integer
   ///  [line: 1392, column: 24, file: SmartCL.Components]
   ,GetScrollWidth:function(Self) {
      var Result = 0;
      var mRef$3 = undefined;
      mRef$3 = $As(Self.FOwner,TW3TagObj).FHandle;
      if (mRef$3) {
         Result = TVariant.AsInteger(mRef$3.scrollWidth);
      } else {
         EW3TagObj.RaiseCntErrMethod("TW3ScrollInfo.GetScrollWidth",Self,"invalid owner handle error");
      }
      return Result
   }
   /// procedure TW3ScrollInfo.ScrollTo(aLeft: Integer; aTop: Integer)
   ///  [line: 1432, column: 25, file: SmartCL.Components]
   ,ScrollTo:function(Self, aLeft$3, aTop$3) {
      var mRef$4 = undefined;
      mRef$4 = $As(Self.FOwner,TW3TagObj).FHandle;
      if (mRef$4) {
         mRef$4.scrollLeft = aLeft$3;
         mRef$4.scrollTop = aTop$3;
      } else {
         EW3TagObj.RaiseCntErrMethod("TW3ScrollInfo.ScrollTo",Self,"invalid owner handle error");
      }
   }
   ,Destroy:TObject.Destroy
   ,AcceptParent$:function($){return $.ClassType.AcceptParent.apply($.ClassType, arguments)}
   ,Create$4:TW3OwnedObject.Create$4
};
/// TW3GraphicControl = class (TW3CustomControl)
///  [line: 547, column: 3, file: SmartCL.Components]
var TW3GraphicControl = {
   $ClassName:"TW3GraphicControl",
   $Parent:TW3CustomControl
   ,$Init:function ($) {
      TW3CustomControl.$Init($);
      $.FCanvas = $.FContext$2 = $.FOnPaint = null;
      $.FDirty$1 = false;
   }
   /// procedure TW3GraphicControl.FinalizeObject()
   ///  [line: 1456, column: 29, file: SmartCL.Components]
   ,FinalizeObject:function(Self) {
      TObject.Free(Self.FCanvas);
      TObject.Free(Self.FContext$2);
      TW3CustomControl.FinalizeObject(Self);
   }
   /// procedure TW3GraphicControl.InitializeObject()
   ///  [line: 1449, column: 29, file: SmartCL.Components]
   ,InitializeObject:function(Self) {
      TW3CustomControl.InitializeObject(Self);
      Self.FContext$2 = TW3ControlGraphicContext.Create$29($New(TW3ControlGraphicContext),Self.FHandle);
      Self.FCanvas = TW3Canvas.Create$31($New(TW3Canvas),Self.FContext$2);
   }
   /// procedure TW3GraphicControl.Invalidate()
   ///  [line: 1509, column: 29, file: SmartCL.Components]
   ,Invalidate:function(Self) {
      if (!Self.FDirty$1) {
         Self.FDirty$1 = true;
         TW3AnimationFrame.ScheduleRefresh(Self);
      }
   }
   /// function TW3GraphicControl.MakeElementTagObj() : THandle
   ///  [line: 1489, column: 28, file: SmartCL.Components]
   ,MakeElementTagObj:function(Self) {
      var Result = undefined;
      Result = w3_createHtmlElement("canvas");
      return Result
   }
   /// procedure TW3GraphicControl.Paint()
   ///  [line: 1494, column: 29, file: SmartCL.Components]
   ,Paint:function(Self) {
      if (Self.FOnPaint) {
         Self.FOnPaint(Self,Self.FCanvas);
      }
   }
   /// procedure TW3GraphicControl.Refresh()
   ///  [line: 1517, column: 29, file: SmartCL.Components]
   ,Refresh:function(Self) {
      Self.FDirty$1 = false;
      if ((((!TW3TagObj.GetUpdating(Self))&&(Self.FCanvas!==null))&&(Self.FContext$2!==null))&&TW3MovableControl.GetVisible(Self)) {
         TW3GraphicControl.Paint$(Self);
      }
   }
   /// procedure TW3GraphicControl.Resize()
   ///  [line: 1500, column: 29, file: SmartCL.Components]
   ,Resize:function(Self) {
      TW3MovableControl.Resize(Self);
      w3_setAttrib(Self.FHandle,"width",w3_getStyle(Self.FHandle,"width"));
      w3_setAttrib(Self.FHandle,"height",w3_getStyle(Self.FHandle,"height"));
   }
   /// procedure TW3GraphicControl.SetHeight(aValue: Integer)
   ///  [line: 1480, column: 29, file: SmartCL.Components]
   ,SetHeight:function(Self, aValue$50) {
      TW3MovableControl.SetHeight(Self,aValue$50);
      if (Self.FHandle) {
         w3_setAttrib(Self.FHandle,"height",TInteger.ToPxStr(aValue$50));
      } else {
         EW3TagObj.RaiseCntErrMethod("TW3GraphicControl.SetHeight",Self,"invalid control handle error");
      }
   }
   /// procedure TW3GraphicControl.SetWidth(aValue: Integer)
   ///  [line: 1471, column: 29, file: SmartCL.Components]
   ,SetWidth:function(Self, aValue$51) {
      TW3MovableControl.SetWidth(Self,aValue$51);
      if (Self.FHandle) {
         w3_setAttrib(Self.FHandle,"width",TInteger.ToPxStr(aValue$51));
      } else {
         EW3TagObj.RaiseCntErrMethod("TW3GraphicControl.SetWidth",Self,"invalid control handle error");
      }
   }
   ,Destroy:TW3TagObj.Destroy
   ,AfterUpdate:TW3CustomControl.AfterUpdate
   ,FinalizeObject$:function($){return $.ClassType.FinalizeObject($)}
   ,InitializeObject$:function($){return $.ClassType.InitializeObject($)}
   ,MakeElementTagId:TW3TagObj.MakeElementTagId
   ,MakeElementTagObj$:function($){return $.ClassType.MakeElementTagObj($)}
   ,StyleTagObject:TW3CustomControl.StyleTagObject
   ,ChildAdded:TW3Component.ChildAdded
   ,Create$18:TW3CustomControl.Create$18
   ,GetHeight:TW3MovableControl.GetHeight
   ,GetWidth:TW3MovableControl.GetWidth
   ,Resize$:function($){return $.ClassType.Resize($)}
   ,SetHeight$:function($){return $.ClassType.SetHeight.apply($.ClassType, arguments)}
   ,SetWidth$:function($){return $.ClassType.SetWidth.apply($.ClassType, arguments)}
   ,supportAdjustment:TW3MovableControl.supportAdjustment
   ,CBClick:TW3CustomControl.CBClick
   ,CBKeyDown:TW3CustomControl.CBKeyDown
   ,CBKeyUp:TW3CustomControl.CBKeyUp
   ,CBMouseDown:TW3CustomControl.CBMouseDown
   ,CBMouseMove:TW3CustomControl.CBMouseMove
   ,CBMouseUp:TW3CustomControl.CBMouseUp
   ,GetEnabled:TW3CustomControl.GetEnabled
   ,Invalidate$:function($){return $.ClassType.Invalidate($)}
   ,SetEnabled:TW3CustomControl.SetEnabled
   ,Paint$:function($){return $.ClassType.Paint($)}
};
/// TW3ControlSizeInfo = record
///  [line: 106, column: 3, file: SmartCL.Components]
function Copy$TW3ControlSizeInfo(s,d) {
   return d;
}
function Clone$TW3ControlSizeInfo($) {
   return {

   }
}
/// TW3CustomFont = class (TObject)
///  [line: 25, column: 3, file: SmartCL.Fonts]
var TW3CustomFont = {
   $ClassName:"TW3CustomFont",
   $Parent:TObject
   ,$Init:function ($) {
      TObject.$Init($);
      $.FOnChange = null;
   }
   /// function TW3CustomFont.GetColor() : TColor
   ///  [line: 119, column: 24, file: SmartCL.Fonts]
   ,GetColor$1:function(Self) {
      var Result = {v:0};
      try {
         var mRef$5 = undefined;
         var mText$2 = "";
         mRef$5 = TW3CustomFont.GetHandle$4$(Self);
         if (mRef$5) {
            mText$2 = ""+w3_getCssStyle(mRef$5,"color");
            Result.v = StrToColor(mText$2);
         } else {
            throw EW3Exception.CreateFmt($New(EW3FontError),$R[0],["TW3CustomFont.GetColor", TObject.ClassName(Self.ClassType), $R[4]]);
         }
      } finally {return Result.v}
   }
   /// function TW3CustomFont.GetName() : String
   ///  [line: 65, column: 24, file: SmartCL.Fonts]
   ,GetName:function(Self) {
      var Result = "";
      var mHandle = undefined;
      mHandle = TW3CustomFont.GetHandle$4$(Self);
      if (mHandle) {
         Result = ""+w3_getCssStyle(mHandle,"font-family");
      } else {
         throw EW3Exception.CreateFmt($New(EW3FontError),$R[0],["TW3CustomFont.GetName", TObject.ClassName(Self.ClassType), $R[4]]);
      }
      return Result
   }
   /// function TW3CustomFont.GetSize() : Integer
   ///  [line: 92, column: 24, file: SmartCL.Fonts]
   ,GetSize:function(Self) {
      var Result = 0;
      var mRef$6 = undefined;
      mRef$6 = TW3CustomFont.GetHandle$4$(Self);
      if (mRef$6) {
         Result = w3_getCssStyleAsInteger(mRef$6,"font-size");
      } else {
         throw EW3Exception.CreateFmt($New(EW3FontError),$R[0],["TW3CustomFont.GetSize", TObject.ClassName(Self.ClassType), $R[4]]);
      }
      return Result
   }
   /// function TW3CustomFont.GetWeight() : String
   ///  [line: 149, column: 24, file: SmartCL.Fonts]
   ,GetWeight:function(Self) {
      var Result = "";
      var mRef$7 = undefined;
      mRef$7 = TW3CustomFont.GetHandle$4$(Self);
      if (mRef$7) {
         Result = ""+w3_getCssStyle(mRef$7,"font-weight");
      } else {
         throw EW3Exception.CreateFmt($New(EW3FontError),$R[0],["TW3CustomFont.GetWeight", TObject.ClassName(Self.ClassType), $R[4]]);
      }
      return Result
   }
   /// procedure TW3CustomFont.SetColor(aNewColor: TColor)
   ///  [line: 134, column: 25, file: SmartCL.Fonts]
   ,SetColor$2:function(Self, aNewColor) {
      var mRef$8 = undefined;
      mRef$8 = TW3CustomFont.GetHandle$4$(Self);
      if (mRef$8) {
         w3_setCssStyle(mRef$8,"color",ColorToWebStr(aNewColor,255));
         if (Self.FOnChange) {
            Self.FOnChange(Self);
         }
      } else {
         throw EW3Exception.CreateFmt($New(EW3FontError),$R[0],["TW3CustomFont.SetColor", TObject.ClassName(Self.ClassType), $R[4]]);
      }
   }
   /// procedure TW3CustomFont.SetName(aNewName: String)
   ///  [line: 77, column: 25, file: SmartCL.Fonts]
   ,SetName$1:function(Self, aNewName) {
      var mHandle$1 = undefined;
      mHandle$1 = TW3CustomFont.GetHandle$4$(Self);
      if (mHandle$1) {
         w3_setCssStyle(mHandle$1,"font-family",aNewName);
         if (Self.FOnChange) {
            Self.FOnChange(Self);
         }
      } else {
         throw EW3Exception.CreateFmt($New(EW3FontError),$R[0],["TW3CustomFont.SetName", TObject.ClassName(Self.ClassType), $R[4]]);
      }
   }
   /// procedure TW3CustomFont.SetSize(aNewSize: Integer)
   ///  [line: 104, column: 25, file: SmartCL.Fonts]
   ,SetSize$5:function(Self, aNewSize) {
      var mRef$9 = undefined;
      mRef$9 = TW3CustomFont.GetHandle$4$(Self);
      if (mRef$9) {
         w3_setCssStyle(mRef$9,"font-size",TInteger.ToPxStr(aNewSize));
         if (Self.FOnChange) {
            Self.FOnChange(Self);
         }
      } else {
         throw EW3Exception.CreateFmt($New(EW3FontError),$R[0],["TW3CustomFont.SetSize", TObject.ClassName(Self.ClassType), $R[4]]);
      }
   }
   /// procedure TW3CustomFont.SetWeight(aNewWeight: String)
   ///  [line: 161, column: 25, file: SmartCL.Fonts]
   ,SetWeight:function(Self, aNewWeight) {
      var mRef$10 = undefined;
      mRef$10 = TW3CustomFont.GetHandle$4$(Self);
      if (mRef$10) {
         w3_setCssStyle(mRef$10,"font-weight",aNewWeight);
         if (Self.FOnChange) {
            Self.FOnChange(Self);
         }
      } else {
         throw EW3Exception.CreateFmt($New(EW3FontError),$R[0],["TW3CustomFont.SetWeight", TObject.ClassName(Self.ClassType), $R[4]]);
      }
   }
   ,Destroy:TObject.Destroy
   ,GetHandle$4$:function($){return $.ClassType.GetHandle$4($)}
};
/// TW3ControlFont = class (TW3CustomFont)
///  [line: 234, column: 3, file: SmartCL.Components]
var TW3ControlFont = {
   $ClassName:"TW3ControlFont",
   $Parent:TW3CustomFont
   ,$Init:function ($) {
      TW3CustomFont.$Init($);
      $.FOwner$3 = null;
   }
   /// function TW3ControlFont.GetHandle() : THandle
   ///  [line: 1345, column: 25, file: SmartCL.Components]
   ,GetHandle$4:function(Self) {
      var Result = undefined;
      Result = Self.FOwner$3.FHandle;
      return Result
   }
   /// constructor TW3ControlFont.Create(AOwner: TW3CustomControl)
   ///  [line: 1336, column: 28, file: SmartCL.Components]
   ,Create$36:function(Self, AOwner$4) {
      TObject.Create(Self);
      if (AOwner$4) {
         Self.FOwner$3 = AOwner$4;
      } else {
         EW3TagObj.RaiseCntErrMethod("TW3ControlFont.Create",Self,"Owner was nil error");
      }
      return Self
   }
   ,Destroy:TObject.Destroy
   ,GetHandle$4$:function($){return $.ClassType.GetHandle$4($)}
};
/// TW3ControlBackground = class (TW3OwnedObject)
///  [line: 245, column: 3, file: SmartCL.Components]
var TW3ControlBackground = {
   $ClassName:"TW3ControlBackground",
   $Parent:TW3OwnedObject
   ,$Init:function ($) {
      TW3OwnedObject.$Init($);
   }
   /// function TW3ControlBackground.AcceptParent(aObject: TObject) : Boolean
   ///  [line: 813, column: 31, file: SmartCL.Components]
   ,AcceptParent:function(Self, aObject$2) {
      var Result = false;
      Result = (aObject$2!==null)&&$Is(aObject$2,TW3MovableControl);
      return Result
   }
   ,Destroy:TObject.Destroy
   ,AcceptParent$:function($){return $.ClassType.AcceptParent.apply($.ClassType, arguments)}
   ,Create$4:TW3OwnedObject.Create$4
};
/// TW3Constraints = class (TW3OwnedObject)
///  [line: 256, column: 3, file: SmartCL.Components]
var TW3Constraints = {
   $ClassName:"TW3Constraints",
   $Parent:TW3OwnedObject
   ,$Init:function ($) {
      TW3OwnedObject.$Init($);
   }
   /// function TW3Constraints.AcceptParent(aObject: TObject) : Boolean
   ///  [line: 732, column: 26, file: SmartCL.Components]
   ,AcceptParent:function(Self, aObject$3) {
      var Result = false;
      Result = (aObject$3!==null)&&$Is(aObject$3,TW3TagObj);
      return Result
   }
   /// function TW3Constraints.GetMaxHeight() : Integer
   ///  [line: 782, column: 26, file: SmartCL.Components]
   ,GetMaxHeight:function(Self) {
      var Result = 0;
      var mRef$11 = undefined;
      mRef$11 = $As(Self.FOwner,TW3MovableControl).FHandle;
      if (mRef$11) {
         Result = w3_getStyleAsInt(mRef$11,"max-height");
      }
      return Result
   }
   /// function TW3Constraints.GetMaxWidth() : Integer
   ///  [line: 773, column: 26, file: SmartCL.Components]
   ,GetMaxWidth:function(Self) {
      var Result = 0;
      var mRef$12 = undefined;
      mRef$12 = $As(Self.FOwner,TW3MovableControl).FHandle;
      if (mRef$12) {
         Result = w3_getStyleAsInt(mRef$12,"max-width");
      }
      return Result
   }
   /// function TW3Constraints.GetMinHeight() : Integer
   ///  [line: 746, column: 26, file: SmartCL.Components]
   ,GetMinHeight:function(Self) {
      var Result = 0;
      var mRef$13 = undefined;
      mRef$13 = $As(Self.FOwner,TW3MovableControl).FHandle;
      if (mRef$13) {
         Result = w3_getStyleAsInt(mRef$13,"min-height");
      }
      return Result
   }
   /// function TW3Constraints.GetMinWidth() : Integer
   ///  [line: 737, column: 26, file: SmartCL.Components]
   ,GetMinWidth:function(Self) {
      var Result = 0;
      var mRef$14 = undefined;
      mRef$14 = $As(Self.FOwner,TW3MovableControl).FHandle;
      if (mRef$14) {
         Result = w3_getStyleAsInt(mRef$14,"min-width");
      }
      return Result
   }
   /// procedure TW3Constraints.SetMaxHeight(aValue: Integer)
   ///  [line: 800, column: 26, file: SmartCL.Components]
   ,SetMaxHeight:function(Self, aValue$52) {
      var mRef$15 = undefined;
      mRef$15 = $As(Self.FOwner,TW3MovableControl).FHandle;
      if (mRef$15) {
         mRef$15.style["max-width"] = TInteger.ToPxStr(aValue$52);
      }
   }
   /// procedure TW3Constraints.SetMaxWidth(aValue: Integer)
   ///  [line: 791, column: 26, file: SmartCL.Components]
   ,SetMaxWidth:function(Self, aValue$53) {
      var mRef$16 = undefined;
      mRef$16 = $As(Self.FOwner,TW3MovableControl).FHandle;
      if (mRef$16) {
         mRef$16.style["max-width"] = TInteger.ToPxStr(aValue$53);
      }
   }
   /// procedure TW3Constraints.SetMinHeight(aValue: Integer)
   ///  [line: 764, column: 26, file: SmartCL.Components]
   ,SetMinHeight:function(Self, aValue$54) {
      var mRef$17 = undefined;
      mRef$17 = $As(Self.FOwner,TW3MovableControl).FHandle;
      if (mRef$17) {
         mRef$17.style["min-height"] = TInteger.ToPxStr(aValue$54);
      }
   }
   /// procedure TW3Constraints.SetMinWidth(aValue: Integer)
   ///  [line: 755, column: 26, file: SmartCL.Components]
   ,SetMinWidth:function(Self, aValue$55) {
      var mRef$18 = undefined;
      mRef$18 = $As(Self.FOwner,TW3MovableControl).FHandle;
      if (mRef$18) {
         mRef$18.style["min-width"] = TInteger.ToPxStr(aValue$55);
      }
   }
   ,Destroy:TObject.Destroy
   ,AcceptParent$:function($){return $.ClassType.AcceptParent.apply($.ClassType, arguments)}
   ,Create$4:TW3OwnedObject.Create$4
};
/// TW3AnimationFrame = class (TObject)
///  [line: 580, column: 3, file: SmartCL.Components]
var TW3AnimationFrame = {
   $ClassName:"TW3AnimationFrame",
   $Parent:TObject
   ,$Init:function ($) {
      TObject.$Init($);
   }
   /// procedure TW3AnimationFrame.Perform()
   ///  [line: 706, column: 35, file: SmartCL.Components]
   ,Perform:function() {
      var i$2 = 0;
      var callbacks = [];
      var controls = [];
      if (vScheduledCallbacks.length>0) {
         callbacks = vScheduledCallbacks;
         vScheduledCallbacks = [];
         var $temp20;
         for(i$2 = 0,$temp20 = callbacks.length;i$2<$temp20;i$2++) {
            callbacks[i$2]();
         }
      }
      if (vScheduledControls.length>0) {
         controls = vScheduledControls;
         vScheduledControls = [];
         var $temp21;
         for(i$2 = 0,$temp21 = controls.length;i$2<$temp21;i$2++) {
            TW3GraphicControl.Refresh(controls[i$2]);
         }
      }
      var $temp22;
      for(i$2 = 0,$temp22 = vOnPerform.length;i$2<$temp22;i$2++) {
         vOnPerform[i$2]();
      }
   }
   /// procedure TW3AnimationFrame.ScheduleRefresh(control: TW3GraphicControl)
   ///  [line: 692, column: 35, file: SmartCL.Components]
   ,ScheduleRefresh:function(control) {
      vScheduledControls.push(control);
      if (!vPending) {
         w3_RequestAnimationFrame(TW3AnimationFrame.Perform);
      }
   }
   ,Destroy:TObject.Destroy
};
/// TShiftStateEnum enumeration
///  [line: 40, column: 3, file: SmartCL.Components]
var TShiftStateEnum = [ "ssShift", "ssAlt", "ssCtrl", "ssMeta", "ssLeft", "ssRight", "ssMiddle" ];
/// TShiftState = class (TObject)
///  [line: 46, column: 3, file: SmartCL.Components]
var TShiftState = {
   $ClassName:"TShiftState",
   $Parent:TObject
   ,$Init:function ($) {
      TObject.$Init($);
      $.FEvent = $.FMouseEvent = null;
      $.FMouseButtons = 0;
   }
   /// function TShiftState.CheckShiftStateEnum(value: TShiftStateEnum) : Boolean
   ///  [line: 639, column: 22, file: SmartCL.Components]
   ,CheckShiftStateEnum:function(Self, value$3) {
      var Result = false;
      if (Self.FEvent===null) {
         Result = false;
      } else {
         switch (value$3) {
            case 0 :
               Result = Self.FEvent.shiftKey;
               break;
            case 1 :
               Result = Self.FEvent.altKey;
               break;
            case 2 :
               Result = Self.FEvent.ctrlKey;
               break;
            case 3 :
               Result = Self.FEvent.metaKey;
               break;
            case 4 :
               Result = (Self.FMouseButtons&1)!=0;
               break;
            case 5 :
               Result = (Self.FMouseButtons&4)!=0;
               break;
            case 6 :
               Result = (Self.FMouseButtons&2)!=0;
               break;
         }
      }
      return Result
   }
   /// function TShiftState.Current() : TShiftState
   ///  [line: 667, column: 28, file: SmartCL.Components]
   ,Current:function() {
      var Result = null;
      if (vCurrent===null) {
         vCurrent = TObject.Create($New(TShiftState));
      }
      Result = vCurrent;
      return Result
   }
   /// procedure TShiftState.SetKeyStateEvent(evt: JKeyStateEvent)
   ///  [line: 655, column: 23, file: SmartCL.Components]
   ,SetKeyStateEvent:function(Self, evt$8) {
      Self.FEvent = evt$8;
      Self.FMouseEvent = null;
   }
   /// procedure TShiftState.SetMouseEvent(evt: JMouseEvent)
   ///  [line: 661, column: 23, file: SmartCL.Components]
   ,SetMouseEvent:function(Self, evt$9) {
      Self.FEvent = evt$9;
      Self.FMouseEvent = evt$9;
   }
   ,Destroy:TObject.Destroy
};
/// TMouseButton enumeration
///  [line: 38, column: 3, file: SmartCL.Components]
var TMouseButton = [ "mbLeft", "mbMiddle", "mbRight" ];
/// TCustomAppContainer = class (TW3Component)
///  [line: 199, column: 3, file: SmartCL.Components]
var TCustomAppContainer = {
   $ClassName:"TCustomAppContainer",
   $Parent:TW3Component
   ,$Init:function ($) {
      TW3Component.$Init($);
   }
   ,Destroy:TW3TagObj.Destroy
   ,AfterUpdate:TW3TagObj.AfterUpdate
   ,FinalizeObject:TW3Component.FinalizeObject
   ,InitializeObject:TW3Component.InitializeObject
   ,MakeElementTagId:TW3TagObj.MakeElementTagId
   ,MakeElementTagObj:TW3TagObj.MakeElementTagObj
   ,StyleTagObject:TW3TagObj.StyleTagObject
   ,ChildAdded:TW3Component.ChildAdded
   ,Create$18:TW3Component.Create$18
};
/// TDocumentBody = class (TCustomAppContainer)
///  [line: 207, column: 3, file: SmartCL.Components]
var TDocumentBody = {
   $ClassName:"TDocumentBody",
   $Parent:TCustomAppContainer
   ,$Init:function ($) {
      TCustomAppContainer.$Init($);
   }
   /// function TDocumentBody.GetHeight() : Integer
   ///  [line: 1326, column: 24, file: SmartCL.Components]
   ,GetHeight$5:function(Self) {
      var Result = 0;
      Result = parseInt(window.innerHeight,10);
      return Result
   }
   /// function TDocumentBody.GetWidth() : Integer
   ///  [line: 1321, column: 24, file: SmartCL.Components]
   ,GetWidth$5:function(Self) {
      var Result = 0;
      Result = parseInt(window.innerWidth,10);
      return Result
   }
   /// function TDocumentBody.makeElementTagId() : String
   ///  [line: 1264, column: 24, file: SmartCL.Components]
   ,MakeElementTagId:function(Self) {
      var Result = "";
      Result = "";
      return Result
   }
   /// function TDocumentBody.makeElementTagObj() : THandle
   ///  [line: 1288, column: 24, file: SmartCL.Components]
   ,MakeElementTagObj:function(Self) {
      var Result = undefined;
      Result = document.body;
      return Result
   }
   /// procedure TDocumentBody.StyleTagObject()
   ///  [line: 1259, column: 25, file: SmartCL.Components]
   ,StyleTagObject:function(Self) {
   }
   ,Destroy:TW3TagObj.Destroy
   ,AfterUpdate:TW3TagObj.AfterUpdate
   ,FinalizeObject:TW3Component.FinalizeObject
   ,InitializeObject:TW3Component.InitializeObject
   ,MakeElementTagId$:function($){return $.ClassType.MakeElementTagId($)}
   ,MakeElementTagObj$:function($){return $.ClassType.MakeElementTagObj($)}
   ,StyleTagObject$:function($){return $.ClassType.StyleTagObject($)}
   ,ChildAdded:TW3Component.ChildAdded
   ,Create$18:TW3Component.Create$18
};
/// EW3TagObj = class (EW3Exception)
///  [line: 30, column: 3, file: SmartCL.Components]
var EW3TagObj = {
   $ClassName:"EW3TagObj",
   $Parent:EW3Exception
   ,$Init:function ($) {
      EW3Exception.$Init($);
   }
   /// procedure EW3TagObj.RaiseCntErrMethod(methName: String; instance: TObject; msg: String)
   ///  [line: 629, column: 27, file: SmartCL.Components]
   ,RaiseCntErrMethod:function(methName, instance, msg) {
      throw EW3Exception.CreateFmt($New(EW3TagObj),$R[0],[methName, (instance!==null)?TObject.ClassName(instance.ClassType):"nil", msg]);
   }
   ,Destroy:Exception.Destroy
};
/// TObjectList = class (TObject)
///  [line: 56, column: 3, file: System.Lists]
var TObjectList = {
   $ClassName:"TObjectList",
   $Parent:TObject
   ,$Init:function ($) {
      TObject.$Init($);
      $.FData$1 = [];
      $.FOnAdded$1 = null;
      $.FOnClear$1 = null;
      $.FOnDeleted$1 = null;
   }
   /// function TObjectList.Add(Value: TObject) : Integer
   ///  [line: 138, column: 22, file: System.Lists]
   ,Add$1:function(Self, Value$8) {
      var Result = 0;
      Result = Self.FData$1.length;
      Self.FData$1.push(Value$8);
      if (Self.FOnAdded$1) {
         Self.FOnAdded$1(Self);
      }
      return Result
   }
   /// procedure TObjectList.Clear()
   ///  [line: 116, column: 23, file: System.Lists]
   ,Clear$2:function(Self) {
      Self.FData$1.length=0;
      if (Self.FOnClear$1) {
         Self.FOnClear$1(Self);
      }
   }
   /// constructor TObjectList.Create()
   ///  [line: 88, column: 25, file: System.Lists]
   ,Create$38:function(Self) {
      TObject.Create(Self);
      return Self
   }
   /// destructor TObjectList.Destroy()
   ///  [line: 93, column: 24, file: System.Lists]
   ,Destroy:function(Self) {
      Self.FData$1.length=0;
      TObject.Destroy(Self);
   }
   /// function TObjectList.GetCount() : Integer
   ///  [line: 123, column: 22, file: System.Lists]
   ,GetCount$1:function(Self) {
      var Result = 0;
      Result = Self.FData$1.length;
      return Result
   }
   /// function TObjectList.GetItem(index: Integer) : TObject
   ///  [line: 128, column: 22, file: System.Lists]
   ,GetItem$5:function(Self, index$1) {
      var Result = null;
      Result = Self.FData$1[index$1];
      return Result
   }
   /// function TObjectList.IndexOf(Value: TObject) : Integer
   ///  [line: 106, column: 22, file: System.Lists]
   ,IndexOf$1:function(Self, Value$9) {
      var Result = 0;
      Result = Self.FData$1.indexOf(Value$9);
      return Result
   }
   /// procedure TObjectList.Insert(Index: Integer; Value: TObject)
   ///  [line: 146, column: 23, file: System.Lists]
   ,Insert$2:function(Self, Index, Value$10) {
      Self.FData$1.splice(Index,0,Value$10);
   }
   /// procedure TObjectList.Remove(ondex: Integer)
   ///  [line: 99, column: 23, file: System.Lists]
   ,Remove$1:function(Self, ondex) {
      Self.FData$1.splice(ondex,1)
      ;
      if (Self.FOnDeleted$1) {
         Self.FOnDeleted$1(Self);
      }
   }
   /// procedure TObjectList.SetItem(index: Integer; value: TObject)
   ///  [line: 133, column: 23, file: System.Lists]
   ,SetItem$1:function(Self, index$2, value$4) {
      Self.FData$1[index$2]=value$4;
   }
   /// procedure TObjectList.Swap(aFirst: Integer; aSecond: Integer)
   ///  [line: 111, column: 23, file: System.Lists]
   ,Swap$1:function(Self, aFirst, aSecond) {
      $ArraySwap(Self.FData$1,aFirst,aSecond);
   }
   ,Destroy$:function($){return $.ClassType.Destroy($)}
};
/// TW3RGBA = record
///  [line: 175, column: 3, file: System.Colors]
function Copy$TW3RGBA(s,d) {
   d.A$40=s.A$40;
   d.B$1=s.B$1;
   d.G$1=s.G$1;
   d.R$1=s.R$1;
   return d;
}
function Clone$TW3RGBA($) {
   return {
      A$40:$.A$40,
      B$1:$.B$1,
      G$1:$.G$1,
      R$1:$.R$1
   }
}
function StrToColor(aColorStr) {
   aColorStr={v:aColorStr};
   var Result = {v:0};
   try {
      var mTemp = "";
      var xpos = 0;
      var r = 0;
      var g = 0;
      var b = 0;
      aColorStr.v = Trim$_String_(aColorStr.v);
      if (aColorStr.v.length==0) {
         return Result.v;
      }
      if ((aColorStr.v.charAt(0)=="#")||(aColorStr.v.charAt(0)=="$")) {
         Result.v = parseInt("0x"+Trim$_String_Integer_Integer_(aColorStr.v,1,0),16);
      } else {
         if ((aColorStr.v).substr(0,2)=="0x") {
            Result.v = parseInt(aColorStr.v,16);
         } else if (((aColorStr.v).substr(0,4)).toLowerCase()=="rgb(") {
            aColorStr.v = Trim$_String_Integer_Integer_(aColorStr.v,4,0);
            try {
               xpos = (aColorStr.v.indexOf(",")+1);
               if (xpos>1) {
                  mTemp = aColorStr.v.substr(0,(xpos-1));
                  Delete(aColorStr,1,xpos);
                  if (mTemp.charAt(0)=="$") {
                     mTemp = "0x"+Trim$_String_Integer_Integer_(mTemp,1,0);
                  }
                  r = parseInt(mTemp,10);
               }
               xpos = (aColorStr.v.indexOf(",")+1);
               if (xpos>1) {
                  mTemp = aColorStr.v.substr(0,(xpos-1));
                  Delete(aColorStr,1,xpos);
                  if (mTemp.charAt(0)=="$") {
                     mTemp = "0x"+Trim$_String_Integer_Integer_(mTemp,1,0);
                  }
                  g = parseInt(mTemp,10);
               }
               xpos = (aColorStr.v.indexOf(")")+1);
               if (xpos>1) {
                  mTemp = aColorStr.v.substr(0,(xpos-1));
                  if (mTemp.charAt(0)=="$") {
                     mTemp = "0x"+Trim$_String_Integer_Integer_(mTemp,1,0);
                  }
                  b = parseInt(mTemp,10);
               }
               Result.v = RGBToColor(r,g,b);
            } catch ($e) {
               var e$6 = $W($e);
               return Result.v;
            }
         }
      }
   } finally {return Result.v}
};
function RGBToColor(aRed, aGreen, aBlue) {
   var Result = 0;
   Result = (aBlue|(aGreen<<8))|(aRed<<16);
   return Result
};
function ColorToWebStr(aColor, alpha) {
   var Result = "";
   Result = ColorToWebStr$1((aColor>>>16)&255,(aColor>>>8)&255,aColor&255,alpha);
   return Result
};
function ColorToWebStr$1(r$1, g$1, b$17, a$57) {
   var Result = "";
   Result = (a$57==255)?"#"+IntToHex2(r$1)+IntToHex2(g$1)+IntToHex2(b$17):"rgba("+r$1.toString()+","+g$1.toString()+","+b$17.toString()+","+FloatToStr$_Float_(a$57/255)+")";
   return Result
};
/// EW3FontError = class (EW3Exception)
///  [line: 22, column: 3, file: SmartCL.Fonts]
var EW3FontError = {
   $ClassName:"EW3FontError",
   $Parent:EW3Exception
   ,$Init:function ($) {
      EW3Exception.$Init($);
   }
   ,Destroy:Exception.Destroy
};
/// TW3TextMetrics = record
///  [line: 115, column: 3, file: SmartCL.Graphics]
function Copy$TW3TextMetrics(s,d) {
   d.Width$4=s.Width$4;
   return d;
}
function Clone$TW3TextMetrics($) {
   return {
      Width$4:$.Width$4
   }
}
/// TW3ImageData = class (TObject)
///  [line: 140, column: 3, file: SmartCL.Graphics]
var TW3ImageData = {
   $ClassName:"TW3ImageData",
   $Parent:TObject
   ,$Init:function ($) {
      TObject.$Init($);
      $.FHandle$1 = null;
   }
   /// procedure TW3ImageData.FromImageData(aImageDataRef: JImageData)
   ///  [line: 438, column: 24, file: SmartCL.Graphics]
   ,FromImageData:function(Self, aImageDataRef) {
      /* null */
Self.FHandle$1 = aImageDataRef;
   }
   ,Destroy:TObject.Destroy
};
/// TW3CustomGraphicContext = class (TObject)
///  [line: 28, column: 3, file: SmartCL.Graphics]
var TW3CustomGraphicContext = {
   $ClassName:"TW3CustomGraphicContext",
   $Parent:TObject
   ,$Init:function ($) {
      TObject.$Init($);
   }
   /// procedure TW3CustomGraphicContext.Allocate(const aWidth: Integer; const aHeight: Integer)
   ///  [line: 774, column: 35, file: SmartCL.Graphics]
   ,Allocate:function(Self, aWidth$2, aHeight$2) {
      if (TW3CustomGraphicContext.GetOwnsReference$(Self)) {
         if (VarIsValidRef(TW3CustomGraphicContext.GetDC$(Self))) {
            TW3CustomGraphicContext.Release(Self);
         }
         TW3CustomGraphicContext.SetSize$1$(Self,aWidth$2,aHeight$2);
      } else {
         throw Exception.Create($New(Exception),"Cannot modify current graphics context");
      }
   }
   /// procedure TW3CustomGraphicContext.Release()
   ///  [line: 785, column: 35, file: SmartCL.Graphics]
   ,Release:function(Self) {
      if (TW3CustomGraphicContext.GetOwnsReference$(Self)) {
         if (VarIsValidRef(TW3CustomGraphicContext.GetDC$(Self))) {
            TW3CustomGraphicContext.ReleaseDC$(Self);
         }
      } else {
         throw Exception.Create($New(Exception),"Cannot modify current graphics context");
      }
   }
   ,Destroy:TObject.Destroy
   ,GetDC$:function($){return $.ClassType.GetDC($)}
   ,GetHandle$:function($){return $.ClassType.GetHandle($)}
   ,GetHeight$1$:function($){return $.ClassType.GetHeight$1($)}
   ,GetOwnsReference$:function($){return $.ClassType.GetOwnsReference($)}
   ,GetWidth$1$:function($){return $.ClassType.GetWidth$1($)}
   ,ReleaseDC$:function($){return $.ClassType.ReleaseDC($)}
   ,SetSize$1$:function($){return $.ClassType.SetSize$1.apply($.ClassType, arguments)}
};
/// TW3GraphicContext = class (TW3CustomGraphicContext)
///  [line: 94, column: 3, file: SmartCL.Graphics]
var TW3GraphicContext = {
   $ClassName:"TW3GraphicContext",
   $Parent:TW3CustomGraphicContext
   ,$Init:function ($) {
      TW3CustomGraphicContext.$Init($);
      $.FObjId = "";
      $.FObjRef = undefined;
      $.FOwner$2 = undefined;
   }
   /// constructor TW3GraphicContext.Create(const AOwner: THandle)
   ///  [line: 812, column: 31, file: SmartCL.Graphics]
   ,Create$28:function(Self, AOwner$5) {
      TObject.Create(Self);
      Self.FObjRef = w3_createHtmlElement("canvas");
      Self.FObjId = w3_GetUniqueObjId();
      Self.FObjRef.id = Self.FObjId;
      Self.FOwner$2 = AOwner$5;
      if (Self.FOwner$2) {
         w3_setElementParentByRef(Self.FObjRef,Self.FOwner$2);
      }
      return Self
   }
   /// destructor TW3GraphicContext.Destroy()
   ///  [line: 832, column: 30, file: SmartCL.Graphics]
   ,Destroy:function(Self) {
      if (Self.FOwner$2) {
         w3_RemoveElementByRef(Self.FObjRef,Self.FOwner$2);
      }
      Self.FOwner$2 = null;
      Self.FObjRef = null;
      TObject.Destroy(Self);
   }
   /// function TW3GraphicContext.GetDC() : THandle
   ///  [line: 854, column: 28, file: SmartCL.Graphics]
   ,GetDC:function(Self) {
      var Result = undefined;
      if (Self.FObjRef) {
         Result = Self.FObjRef.getContext("2d");
      } else {
         Result = null;
      }
      return Result
   }
   /// function TW3GraphicContext.GetHandle() : THandle
   ///  [line: 844, column: 28, file: SmartCL.Graphics]
   ,GetHandle:function(Self) {
      var Result = undefined;
      Result = Self.FObjRef;
      return Result
   }
   /// function TW3GraphicContext.GetHeight() : Integer
   ///  [line: 877, column: 28, file: SmartCL.Graphics]
   ,GetHeight$1:function(Self) {
      var Result = 0;
      if (Self.FObjRef) {
         Result = parseInt(Self.FObjRef.height,10);
      }
      return Result
   }
   /// function TW3GraphicContext.GetOwnsReference() : Boolean
   ///  [line: 849, column: 28, file: SmartCL.Graphics]
   ,GetOwnsReference:function(Self) {
      var Result = false;
      Result = true;
      return Result
   }
   /// function TW3GraphicContext.GetWidth() : Integer
   ///  [line: 871, column: 28, file: SmartCL.Graphics]
   ,GetWidth$1:function(Self) {
      var Result = 0;
      if (Self.FObjRef) {
         Result = parseInt(Self.FObjRef.width,10);
      }
      return Result
   }
   /// procedure TW3GraphicContext.ReleaseDC()
   ///  [line: 883, column: 29, file: SmartCL.Graphics]
   ,ReleaseDC:function(Self) {
      if (Self.FObjRef) {
         Self.FObjRef.width = 0;
         Self.FObjRef.height = 0;
      }
   }
   /// procedure TW3GraphicContext.SetSize(aNewWidth: Integer; aNewHeight: Integer)
   ///  [line: 862, column: 29, file: SmartCL.Graphics]
   ,SetSize$1:function(Self, aNewWidth, aNewHeight) {
      if (Self.FObjRef) {
         Self.FObjRef.width = aNewWidth;
         Self.FObjRef.height = aNewHeight;
      }
   }
   ,Destroy$:function($){return $.ClassType.Destroy($)}
   ,GetDC$:function($){return $.ClassType.GetDC($)}
   ,GetHandle$:function($){return $.ClassType.GetHandle($)}
   ,GetHeight$1$:function($){return $.ClassType.GetHeight$1($)}
   ,GetOwnsReference$:function($){return $.ClassType.GetOwnsReference($)}
   ,GetWidth$1$:function($){return $.ClassType.GetWidth$1($)}
   ,ReleaseDC$:function($){return $.ClassType.ReleaseDC($)}
   ,SetSize$1$:function($){return $.ClassType.SetSize$1.apply($.ClassType, arguments)}
};
/// TW3ControlGraphicContext = class (TW3CustomGraphicContext)
///  [line: 54, column: 3, file: SmartCL.Graphics]
var TW3ControlGraphicContext = {
   $ClassName:"TW3ControlGraphicContext",
   $Parent:TW3CustomGraphicContext
   ,$Init:function ($) {
      TW3CustomGraphicContext.$Init($);
      $.FCtrlTag = undefined;
   }
   /// constructor TW3ControlGraphicContext.Create(const aControlHandle: THandle)
   ///  [line: 726, column: 38, file: SmartCL.Graphics]
   ,Create$29:function(Self, aControlHandle) {
      TObject.Create(Self);
      if (aControlHandle) {
         Self.FCtrlTag = aControlHandle;
      } else {
         throw Exception.Create($New(Exception),"Control handle is invalid error");
      }
      return Self
   }
   /// function TW3ControlGraphicContext.GetDC() : THandle
   ///  [line: 735, column: 35, file: SmartCL.Graphics]
   ,GetDC:function(Self) {
      var Result = undefined;
      Result = Self.FCtrlTag.getContext("2d");
      return Result
   }
   /// function TW3ControlGraphicContext.GetHandle() : THandle
   ///  [line: 740, column: 35, file: SmartCL.Graphics]
   ,GetHandle:function(Self) {
      var Result = undefined;
      Result = Self.FCtrlTag;
      return Result
   }
   /// function TW3ControlGraphicContext.GetHeight() : Integer
   ///  [line: 750, column: 35, file: SmartCL.Graphics]
   ,GetHeight$1:function(Self) {
      var Result = 0;
      Result = w3_getPropertyAsInt(Self.FCtrlTag,"height");
      return Result
   }
   /// function TW3ControlGraphicContext.GetOwnsReference() : Boolean
   ///  [line: 755, column: 35, file: SmartCL.Graphics]
   ,GetOwnsReference:function(Self) {
      var Result = false;
      Result = false;
      return Result
   }
   /// function TW3ControlGraphicContext.GetWidth() : Integer
   ///  [line: 745, column: 35, file: SmartCL.Graphics]
   ,GetWidth$1:function(Self) {
      var Result = 0;
      Result = w3_getPropertyAsInt(Self.FCtrlTag,"width");
      return Result
   }
   /// procedure TW3ControlGraphicContext.ReleaseDC()
   ///  [line: 765, column: 36, file: SmartCL.Graphics]
   ,ReleaseDC:function(Self) {
   }
   /// procedure TW3ControlGraphicContext.SetSize(aNewWidth: Integer; aNewHeight: Integer)
   ///  [line: 760, column: 36, file: SmartCL.Graphics]
   ,SetSize$1:function(Self, aNewWidth$1, aNewHeight$1) {
   }
   ,Destroy:TObject.Destroy
   ,GetDC$:function($){return $.ClassType.GetDC($)}
   ,GetHandle$:function($){return $.ClassType.GetHandle($)}
   ,GetHeight$1$:function($){return $.ClassType.GetHeight$1($)}
   ,GetOwnsReference$:function($){return $.ClassType.GetOwnsReference($)}
   ,GetWidth$1$:function($){return $.ClassType.GetWidth$1($)}
   ,ReleaseDC$:function($){return $.ClassType.ReleaseDC($)}
   ,SetSize$1$:function($){return $.ClassType.SetSize$1.apply($.ClassType, arguments)}
};
/// TW3CanvasPattern = class (TObject)
///  [line: 133, column: 3, file: SmartCL.Graphics]
var TW3CanvasPattern = {
   $ClassName:"TW3CanvasPattern",
   $Parent:TObject
   ,$Init:function ($) {
      TObject.$Init($);
   }
   ,Destroy:TObject.Destroy
};
/// TW3CanvasGradient = class (TObject)
///  [line: 119, column: 3, file: SmartCL.Graphics]
var TW3CanvasGradient = {
   $ClassName:"TW3CanvasGradient",
   $Parent:TObject
   ,$Init:function ($) {
      TObject.$Init($);
      $.FHandle$3 = undefined;
   }
   /// constructor TW3CanvasGradient.Create(const aHandle: THandle)
   ///  [line: 603, column: 31, file: SmartCL.Graphics]
   ,Create$30:function(Self, aHandle) {
      TObject.Create(Self);
      Self.FHandle$3 = aHandle;
      return Self
   }
   ,Destroy:TObject.Destroy
};
/// TW3Canvas = class (TObject)
///  [line: 181, column: 3, file: SmartCL.Graphics]
var TW3Canvas = {
   $ClassName:"TW3Canvas",
   $Parent:TObject
   ,$Init:function ($) {
      TObject.$Init($);
      $.FContext = $.FDC = null;
   }
   /// constructor TW3Canvas.Create(Context: TW3CustomGraphicContext)
   ///  [line: 896, column: 23, file: SmartCL.Graphics]
   ,Create$31:function(Self, Context$2) {
      TObject.Create(Self);
      Self.FContext = Context$2;
      if (!Self.FContext) {
         throw Exception.Create($New(Exception),"Invalid canvas context error");
      } else {
         Self.FDC = TW3CustomGraphicContext.GetDC$(Self.FContext);
      }
      return Self
   }
   /// procedure TW3Canvas.DrawImageF(imageHandle: THandle; x: Float; y: Float)
   ///  [line: 1193, column: 21, file: SmartCL.Graphics]
   ,DrawImageF:function(Self, imageHandle, x$14, y$5) {
      Self.FDC.drawImage(imageHandle,x$14,y$5);
   }
   /// procedure TW3Canvas.FillRectF(aLeft: Float; aTop: Float; aWidth: Float; aHeight: Float)
   ///  [line: 1070, column: 21, file: SmartCL.Graphics]
   ,FillRectF$2:function(Self, aLeft$4, aTop$4, aWidth$3, aHeight$3) {
      Self.FDC.fillRect(aLeft$4,aTop$4,aWidth$3,aHeight$3);
   }
   /// procedure TW3Canvas.FillTextF(text: String; x: Float; y: Float; maxWidth: Float)
   ///  [line: 1223, column: 21, file: SmartCL.Graphics]
   ,FillTextF:function(Self, text, x$15, y$6, maxWidth$1) {
      Self.FDC.fillText(text,x$15,y$6,maxWidth$1);
   }
   /// function TW3Canvas.GetFillStyle() : String
   ///  [line: 1572, column: 20, file: SmartCL.Graphics]
   ,GetFillStyle:function(Self) {
      var Result = "";
      Result = ""+Self.FDC.fillStyle;
      return Result
   }
   /// function TW3Canvas.GetGlobalAlpha() : Float
   ///  [line: 1438, column: 20, file: SmartCL.Graphics]
   ,GetGlobalAlpha:function(Self) {
      var Result = 0;
      Result = Self.FDC.globalAlpha;
      return Result
   }
   /// function TW3Canvas.MeasureText(aText: String) : TW3TextMetrics
   ///  [line: 1180, column: 20, file: SmartCL.Graphics]
   ,MeasureText:function(Self, aText$1) {
      var Result = {Width$4:0};
      var metrics = undefined;
      metrics = Self.FDC.measureText(aText$1);
      Result.Width$4 = Number(metrics.width);
      return Result
   }
   /// procedure TW3Canvas.SetFillStyle(aValue: String)
   ///  [line: 1577, column: 21, file: SmartCL.Graphics]
   ,SetFillStyle:function(Self, aValue$56) {
      Self.FDC.fillStyle = aValue$56;
   }
   /// procedure TW3Canvas.SetGlobalAlpha(aValue: Float)
   ///  [line: 1443, column: 21, file: SmartCL.Graphics]
   ,SetGlobalAlpha:function(Self, aValue$57) {
      Self.FDC.globalAlpha = aValue$57;
   }
   /// function TW3Canvas.ToDataURL(aMimeType: String) : String
   ///  [line: 1322, column: 20, file: SmartCL.Graphics]
   ,ToDataURL:function(Self, aMimeType) {
      var Result = "";
      Result = Self.FDC.canvas.toDataURL(aMimeType);
      return Result
   }
   /// function TW3Canvas.ToImageData() : TW3ImageData
   ///  [line: 1327, column: 20, file: SmartCL.Graphics]
   ,ToImageData:function(Self) {
      var Result = null;
      var mTemp$2 = null;
      var wd$1 = 0;
      var hd$1 = 0;
      wd$1 = Self.FDC.canvas.width;
      hd$1 = Self.FDC.canvas.height;
      try {
         mTemp$2 = Self.FDC.getImageData(0,0,wd$1,hd$1);
      } catch ($e) {
         var e$7 = $W($e);
         throw Exception.Create($New(Exception),"Failed to extract data, browser threw exception: "+e$7.FMessage);
      }
      if (mTemp$2) {
         Result = TObject.Create($New(TW3ImageData));
         TW3ImageData.FromImageData(Result,mTemp$2);
      }
      return Result
   }
   ,Destroy:TObject.Destroy
};
/// JMouseButton enumeration
///  [line: 142, column: 3, file: W3C.DOM]
var JMouseButton = [ "Left", "Middle", "Right" ];
/// TW3CSSClassStyleNames = class (TW3OwnedObject)
///  [line: 24, column: 3, file: SmartCL.CssNames]
var TW3CSSClassStyleNames = {
   $ClassName:"TW3CSSClassStyleNames",
   $Parent:TW3OwnedObject
   ,$Init:function ($) {
      TW3OwnedObject.$Init($);
      $.FCache = [];
      $.FToken = "";
   }
   /// function TW3CSSClassStyleNames.AcceptParent(aObject: TObject) : Boolean
   ///  [line: 73, column: 32, file: SmartCL.CssNames]
   ,AcceptParent:function(Self, aObject$4) {
      var Result = false;
      Result = (aObject$4!==null)&&$Is(aObject$4,TW3CustomControl);
      return Result
   }
   /// function TW3CSSClassStyleNames.Add(aCSSClassName: String) : Integer
   ///  [line: 255, column: 32, file: SmartCL.CssNames]
   ,Add$2:function(Self, aCSSClassName) {
      var Result = 0;
      var mRef$19 = undefined;
      if (Self.FOwner) {
         mRef$19 = $As(Self.FOwner,TW3TagObj).FHandle;
         if (mRef$19) {
            w3_AddClass(mRef$19,aCSSClassName);
            Self.FCache.push(aCSSClassName);
            Result = Self.FCache.length-1;
         } else {
            throw EW3Exception.CreateFmt($New(EW3TagObj),$R[0],["TW3CSSClassStyleNames.Add", TObject.ClassName(Self.ClassType), "invalid owner handle error"]);
         }
      } else {
         throw EW3Exception.CreateFmt($New(EW3CSSClassStyleNames),$R[0],["TW3CSSClassStyleNames.Add", TObject.ClassName(Self.ClassType), $R[9]]);
      }
      return Result
   }
   /// constructor TW3CSSClassStyleNames.Create(AOwner: TObject)
   ///  [line: 60, column: 35, file: SmartCL.CssNames]
   ,Create$4:function(Self, AOwner$6) {
      TW3OwnedObject.Create$4(Self,AOwner$6);
      Self.FToken = "class";
      Self.FCache = [];
      return Self
   }
   /// destructor TW3CSSClassStyleNames.Destroy()
   ///  [line: 67, column: 34, file: SmartCL.CssNames]
   ,Destroy:function(Self) {
      Self.FCache.length=0;
      TObject.Destroy(Self);
   }
   /// function TW3CSSClassStyleNames.IndexOf(aCSSClassName: String) : Integer
   ///  [line: 202, column: 32, file: SmartCL.CssNames]
   ,IndexOf$2:function(Self, aCSSClassName$1) {
      var Result = 0;
      var x$16 = 0;
      Result = -1;
      if (Self.FOwner) {
         aCSSClassName$1 = (Trim$_String_(aCSSClassName$1)).toLowerCase();
         if (aCSSClassName$1.length>0) {
            var $temp23;
            for(x$16 = 0,$temp23 = Self.FCache.length;x$16<$temp23;x$16++) {
               if ((Self.FCache[x$16]).toLowerCase()==aCSSClassName$1) {
                  Result = x$16;
                  break;
               }
            }
         }
      } else {
         throw EW3Exception.CreateFmt($New(EW3CSSClassStyleNames),$R[0],["TW3CSSClassStyleNames.IndexOf", TObject.ClassName(Self.ClassType), $R[9]]);
      }
      return Result
   }
   /// function TW3CSSClassStyleNames.RemoveByName(aCSSClassName: String) : String
   ///  [line: 299, column: 32, file: SmartCL.CssNames]
   ,RemoveByName:function(Self, aCSSClassName$2) {
      var Result = "";
      var mRef$20 = undefined;
      var mIndex$3 = 0;
      if (Self.FOwner) {
         mRef$20 = $As(Self.FOwner,TW3TagObj).FHandle;
         if (mRef$20) {
            w3_RemoveClass(mRef$20,aCSSClassName$2);
            mIndex$3 = TW3CSSClassStyleNames.IndexOf$2(Self,aCSSClassName$2);
            if (mIndex$3>=0) {
               Self.FCache.splice(mIndex$3,1)
               ;
            }
            Result = aCSSClassName$2;
         } else {
            throw EW3Exception.CreateFmt($New(EW3TagObj),$R[0],["TW3CSSClassStyleNames.RemoveByName", TObject.ClassName(Self.ClassType), "invalid owner handle error"]);
         }
      } else {
         throw EW3Exception.CreateFmt($New(EW3CSSClassStyleNames),$R[0],["TW3CSSClassStyleNames.RemoveByName", TObject.ClassName(Self.ClassType), $R[9]]);
      }
      return Result
   }
   ,Destroy$:function($){return $.ClassType.Destroy($)}
   ,AcceptParent$:function($){return $.ClassType.AcceptParent.apply($.ClassType, arguments)}
   ,Create$4$:function($){return $.ClassType.Create$4.apply($.ClassType, arguments)}
};
/// EW3CSSClassStyleNames = class (EW3Exception)
///  [line: 22, column: 3, file: SmartCL.CssNames]
var EW3CSSClassStyleNames = {
   $ClassName:"EW3CSSClassStyleNames",
   $Parent:EW3Exception
   ,$Init:function ($) {
      EW3Exception.$Init($);
   }
   ,Destroy:Exception.Destroy
};
/// TW3TouchList = class (TObject)
///  [line: 58, column: 3, file: SmartCL.Touch]
var TW3TouchList = {
   $ClassName:"TW3TouchList",
   $Parent:TObject
   ,$Init:function ($) {
      TObject.$Init($);
      $.FObjects = [];
   }
   /// anonymous TSourceMethodSymbol
   ///  [line: 62, column: 53, file: SmartCL.Touch]
   ,a$25:function(Self, index$3) {
      return Self.FObjects[index$3];
   }
   /// anonymous TSourceMethodSymbol
   ///  [line: 63, column: 34, file: SmartCL.Touch]
   ,a$24:function(Self) {
      return Self.FObjects.length;
   }
   /// procedure TW3TouchList.Clear()
   ///  [line: 131, column: 24, file: SmartCL.Touch]
   ,Clear$3:function(Self) {
      Self.FObjects.length=0;
   }
   /// procedure TW3TouchList.Update(refObj: JTouchList)
   ///  [line: 141, column: 24, file: SmartCL.Touch]
   ,Update:function(Self, refObj) {
      var mCount$2 = 0;
      var x$17 = 0;
      var mObj$8 = null;
      mCount$2 = refObj.length;
      if (mCount$2==Self.FObjects.length) {
         var $temp24;
         for(x$17 = 0,$temp24 = mCount$2;x$17<$temp24;x$17++) {
            TW3Touch.Consume$1(Self.FObjects[x$17],refObj[x$17]);
         }
      } else {
         TW3TouchList.Clear$3(Self);
         var $temp25;
         for(x$17 = 0,$temp25 = mCount$2;x$17<$temp25;x$17++) {
            mObj$8 = TObject.Create($New(TW3Touch));
            TW3Touch.Consume$1(mObj$8,refObj[x$17]);
            Self.FObjects.push(mObj$8);
         }
      }
   }
   ,Destroy:TObject.Destroy
};
/// TW3TouchData = class (TObject)
///  [line: 70, column: 3, file: SmartCL.Touch]
var TW3TouchData = {
   $ClassName:"TW3TouchData",
   $Parent:TObject
   ,$Init:function ($) {
      TObject.$Init($);
      $.FChanged = $.FTouches = null;
   }
   /// function TW3TouchData.GetChanged() : TW3TouchList
   ///  [line: 191, column: 23, file: SmartCL.Touch]
   ,GetChanged:function(Self) {
      var Result = null;
      if (!Self.FChanged) {
         Self.FChanged = TObject.Create($New(TW3TouchList));
         TW3TouchList.Update(Self.FChanged,event.changedTouches);
      }
      Result = Self.FChanged;
      return Result
   }
   /// function TW3TouchData.GetTouches() : TW3TouchList
   ///  [line: 180, column: 23, file: SmartCL.Touch]
   ,GetTouches:function(Self) {
      var Result = null;
      if (!Self.FTouches) {
         Self.FTouches = TObject.Create($New(TW3TouchList));
         TW3TouchList.Update(Self.FTouches,event.touches);
      }
      Result = Self.FTouches;
      return Result
   }
   /// procedure TW3TouchData.Update(eventObj: JTouchEvent)
   ///  [line: 172, column: 24, file: SmartCL.Touch]
   ,Update$1:function(Self, eventObj$17) {
      if (Self.FTouches) {
         TW3TouchList.Update(Self.FTouches,eventObj$17.touches);
      }
      if (Self.FChanged) {
         TW3TouchList.Update(Self.FChanged,eventObj$17.changedTouches);
      }
   }
   ,Destroy:TObject.Destroy
};
/// TW3Touch = class (TObject)
///  [line: 34, column: 3, file: SmartCL.Touch]
var TW3Touch = {
   $ClassName:"TW3Touch",
   $Parent:TObject
   ,$Init:function ($) {
      TObject.$Init($);
      $.FClientX = $.FClientY = $.FPageX = $.FPageY = $.FScreenX = $.FScreenY = 0;
      $.FIdent = undefined;
      $.FTarget = null;
   }
   /// procedure TW3Touch.Consume(touch: JTouch)
   ///  [line: 104, column: 20, file: SmartCL.Touch]
   ,Consume$1:function(Self, touch) {
      Self.FScreenX = touch.screenX;
      Self.FScreenY = touch.screenY;
      Self.FClientX = touch.clientX;
      Self.FClientY = touch.clientY;
      Self.FPageX = touch.pageX;
      Self.FPageY = touch.pageY;
      Self.FIdent = touch.identifier;
      Self.FTarget = TVariant.AsObject(touch.target);
   }
   ,Destroy:TObject.Destroy
};
/// TW3GestureData = class (TObject)
///  [line: 83, column: 3, file: SmartCL.Touch]
var TW3GestureData = {
   $ClassName:"TW3GestureData",
   $Parent:TObject
   ,$Init:function ($) {
      TObject.$Init($);
      $.FRotation = $.FScale = 0;
   }
   /// procedure TW3GestureData.Consume(refObj: THandle)
   ///  [line: 206, column: 26, file: SmartCL.Touch]
   ,Consume$2:function(Self, refObj$1) {
      Self.FRotation = Number(refObj$1.rotation);
      Self.FScale = Number(refObj$1.scale);
   }
   /// procedure TW3GestureData.Update()
   ///  [line: 213, column: 26, file: SmartCL.Touch]
   ,Update$2:function(Self) {
      TW3GestureData.Consume$2(Self,event);
   }
   ,Destroy:TObject.Destroy
};
/// TW3Borders = class (TW3OwnedObject)
///  [line: 56, column: 3, file: SmartCL.Borders]
var TW3Borders = {
   $ClassName:"TW3Borders",
   $Parent:TW3OwnedObject
   ,$Init:function ($) {
      TW3OwnedObject.$Init($);
      $.FBottom = $.FLeft = $.FRight = $.FTop = null;
   }
   /// function TW3Borders.AcceptParent(AObject: TObject) : Boolean
   ///  [line: 338, column: 21, file: SmartCL.Borders]
   ,AcceptParent:function(Self, AObject) {
      var Result = false;
      Result = $Is(AObject,TW3TagObj);
      return Result
   }
   /// constructor TW3Borders.Create(AOwner: TObject)
   ///  [line: 291, column: 24, file: SmartCL.Borders]
   ,Create$4:function(Self, AOwner$7) {
      TW3OwnedObject.Create$4(Self,AOwner$7);
      Self.FLeft = TW3Border.Create$41($New(TW3Border),Self,0);
      Self.FTop = TW3Border.Create$41($New(TW3Border),Self,1);
      Self.FRight = TW3Border.Create$41($New(TW3Border),Self,2);
      Self.FBottom = TW3Border.Create$41($New(TW3Border),Self,3);
      return Self
   }
   /// destructor TW3Borders.Destroy()
   ///  [line: 300, column: 23, file: SmartCL.Borders]
   ,Destroy:function(Self) {
      TObject.Free(Self.FLeft);
      TObject.Free(Self.FTop);
      TObject.Free(Self.FRight);
      TObject.Free(Self.FBottom);
      TObject.Destroy(Self);
   }
   /// function TW3Borders.GetHSpace() : Integer
   ///  [line: 333, column: 21, file: SmartCL.Borders]
   ,GetHSpace:function(Self) {
      var Result = 0;
      Result = TW3Border.GetWidth$6(Self.FLeft)+TW3Border.GetPadding(Self.FLeft)+TW3Border.GetWidth$6(Self.FRight)+TW3Border.GetPadding(Self.FRight);
      return Result
   }
   /// function TW3Borders.GetVSpace() : Integer
   ///  [line: 328, column: 21, file: SmartCL.Borders]
   ,GetVSpace:function(Self) {
      var Result = 0;
      Result = TW3Border.GetWidth$6(Self.FTop)+TW3Border.GetPadding(Self.FTop)+TW3Border.GetWidth$6(Self.FBottom)+TW3Border.GetPadding(Self.FBottom);
      return Result
   }
   ,Destroy$:function($){return $.ClassType.Destroy($)}
   ,AcceptParent$:function($){return $.ClassType.AcceptParent.apply($.ClassType, arguments)}
   ,Create$4$:function($){return $.ClassType.Create$4.apply($.ClassType, arguments)}
};
/// TW3BorderEdgeStyle enumeration
///  [line: 23, column: 3, file: SmartCL.Borders]
var TW3BorderEdgeStyle = [ "besNone", "besSolid", "besDotted", "besDouble", "besGroove", "besInset", "besOutset" ];
/// TW3BorderEdge enumeration
///  [line: 22, column: 3, file: SmartCL.Borders]
var TW3BorderEdge = [ "beLeft", "beTop", "beRight", "beBottom" ];
/// TW3Border = class (TObject)
///  [line: 28, column: 3, file: SmartCL.Borders]
var TW3Border = {
   $ClassName:"TW3Border",
   $Parent:TObject
   ,$Init:function ($) {
      TObject.$Init($);
      $.FEdge = 0;
      $.FEdgeName = "";
      $.FOwner$4 = null;
   }
   /// constructor TW3Border.Create(AOwner: TW3Borders; AEdge: TW3BorderEdge)
   ///  [line: 94, column: 23, file: SmartCL.Borders]
   ,Create$41:function(Self, AOwner$8, AEdge) {
      TObject.Create(Self);
      Self.FOwner$4 = AOwner$8;
      Self.FEdge = Self.FEdge;
      switch (AEdge) {
         case 0 :
            Self.FEdgeName = "left";
            break;
         case 1 :
            Self.FEdgeName = "top";
            break;
         case 2 :
            Self.FEdgeName = "right";
            break;
         case 3 :
            Self.FEdgeName = "bottom";
            break;
      }
      return Self
   }
   /// function TW3Border.GetPadding() : Integer
   ///  [line: 131, column: 20, file: SmartCL.Borders]
   ,GetPadding:function(Self) {
      var Result = 0;
      var mRef$21 = undefined;
      var mKey = "";
      Result = 0;
      mRef$21 = $As(Self.FOwner$4.FOwner,TW3TagObj).FHandle;
      if (mRef$21) {
         mKey = "padding-"+Self.FEdgeName;
         Result = w3_getCssStyleAsInteger(mRef$21,mKey);
      }
      return Result
   }
   /// function TW3Border.GetWidth() : Integer
   ///  [line: 189, column: 20, file: SmartCL.Borders]
   ,GetWidth$6:function(Self) {
      var Result = 0;
      var mRef$22 = undefined;
      var mKey$1 = "";
      Result = 0;
      mRef$22 = $As(Self.FOwner$4.FOwner,TW3TagObj).FHandle;
      if (mRef$22) {
         mKey$1 = "border-"+Self.FEdgeName+"-width";
         Result = w3_getCssStyleAsInteger(mRef$22,mKey$1);
      }
      return Result
   }
   /// procedure TW3Border.SetPadding(aValue: Integer)
   ///  [line: 145, column: 21, file: SmartCL.Borders]
   ,SetPadding:function(Self, aValue$58) {
      var mRef$23 = undefined;
      var mKey$2 = "";
      mRef$23 = $As(Self.FOwner$4.FOwner,TW3TagObj).FHandle;
      if (mRef$23) {
         mKey$2 = "padding-"+Self.FEdgeName;
         w3_setCssStyle(mRef$23,mKey$2,TInteger.ToPxStr(aValue$58));
      } else {
         throw EW3Exception.CreateFmt($New(EW3TagObj),$R[0],["TW3Border.SetPadding", TObject.ClassName(Self.ClassType), $R[12]]);
      }
   }
   /// procedure TW3Border.SetWidth(aValue: Integer)
   ///  [line: 203, column: 21, file: SmartCL.Borders]
   ,SetWidth$2:function(Self, aValue$59) {
      var mRef$24 = undefined;
      var mKey$3 = "";
      mRef$24 = $As(Self.FOwner$4.FOwner,TW3TagObj).FHandle;
      if (mRef$24) {
         mKey$3 = "border-"+Self.FEdgeName+"-width";
         w3_setCssStyle(mRef$24,mKey$3,TInteger.ToPxStr(aValue$59));
      } else {
         throw EW3Exception.CreateFmt($New(EW3TagObj),$R[0],["TW3Border.SetWidth", TObject.ClassName(Self.ClassType), $R[12]]);
      }
   }
   ,Destroy:TObject.Destroy
};
/// TW3CustomAnimation = class (TObject)
///  [line: 25, column: 3, file: SmartCL.Effects]
var TW3CustomAnimation = {
   $ClassName:"TW3CustomAnimation",
   $Parent:TObject
   ,$Init:function ($) {
      TObject.$Init($);
      $.FBusy = false;
      $.FDuration = 0;
      $.FInEvnCB = null;
      $.FOnBegins = null;
      $.FOnEnds = null;
      $.FTarget$1 = null;
   }
   /// procedure TW3CustomAnimation.CBBegins()
   ///  [line: 457, column: 30, file: SmartCL.Effects]
   ,CBBegins:function(Self) {
      if (Self.FOnBegins) {
         Self.FOnBegins(Self);
      }
   }
   /// procedure TW3CustomAnimation.CBEnds()
   ///  [line: 463, column: 30, file: SmartCL.Effects]
   ,CBEnds:function(Self) {
      TW3CustomAnimation.FinalizeTransition$(Self);
      if (Self.FOnEnds) {
         Self.FOnEnds(Self);
      }
   }
   /// constructor TW3CustomAnimation.Create()
   ///  [line: 436, column: 32, file: SmartCL.Effects]
   ,Create$42:function(Self) {
      TObject.Create(Self);
      Self.FDuration = DefaultDuration;
      return Self
   }
   /// destructor TW3CustomAnimation.Destroy()
   ///  [line: 442, column: 31, file: SmartCL.Effects]
   ,Destroy:function(Self) {
      if (Self.FBusy&&(Self.FTarget$1!==null)) {
         try {
            TW3CustomAnimation.FinalizeTransition$(Self);
         } catch ($e) {
            var e$8 = $W($e);
            /* null */
         }
      }
      TObject.Destroy(Self);
   }
   /// procedure TW3CustomAnimation.ExecuteEx(TargetObj: TW3TagObj; BeginHandler: TFxAnimationBeginsEvent; EndHandler: TFxAnimationEndsEvent)
   ///  [line: 513, column: 30, file: SmartCL.Effects]
   ,ExecuteEx:function(Self, TargetObj, BeginHandler, EndHandler) {
      if (!TargetObj) {
         throw Exception.Create($New(Exception),"Target-object was NIL error");
      }
      if (!Self.FBusy) {
         Self.FTarget$1 = TargetObj;
         Self.FOnBegins = BeginHandler;
         Self.FOnEnds = EndHandler;
         TW3CustomAnimation.SetupTransition$(Self);
      } else {
         throw Exception.Create($New(Exception),"Transition is already in progress error");
      }
   }
   /// procedure TW3CustomAnimation.FinalizeTransition()
   ///  [line: 492, column: 30, file: SmartCL.Effects]
   ,FinalizeTransition:function(Self) {
      w3_RemoveEvent(Self.FTarget$1.FHandle,"animationend",Self.FInEvnCB,true);
      w3_RemoveEvent(Self.FTarget$1.FHandle,"webkitAnimationEnd",Self.FInEvnCB,true);
      Self.FBusy = false;
   }
   /// procedure TW3CustomAnimation.SetDuration(Value: Float)
   ///  [line: 470, column: 30, file: SmartCL.Effects]
   ,SetDuration:function(Self, Value$11) {
      if (!Self.FBusy) {
         Self.FDuration = Value$11;
      } else {
         throw Exception.Create($New(Exception),"Duration cannot be altered while the transition is active error");
      }
   }
   /// procedure TW3CustomAnimation.SetupTransition()
   ///  [line: 478, column: 30, file: SmartCL.Effects]
   ,SetupTransition:function(Self) {
      Self.FBusy = true;
      Self.FInEvnCB = $Event0(Self,TW3CustomAnimation.CBEnds);
      w3_AddEvent(Self.FTarget$1.FHandle,"animationend",Self.FInEvnCB,true);
      w3_AddEvent(Self.FTarget$1.FHandle,"webkitAnimationEnd",Self.FInEvnCB,true);
      TW3CustomAnimation.CBBegins(Self);
   }
   ,Destroy$:function($){return $.ClassType.Destroy($)}
   ,Create$42$:function($){return $.ClassType.Create$42($)}
   ,FinalizeTransition$:function($){return $.ClassType.FinalizeTransition($)}
   ,SetupTransition$:function($){return $.ClassType.SetupTransition($)}
};
/// TW3NamedAnimation = class (TW3CustomAnimation)
///  [line: 60, column: 3, file: SmartCL.Effects]
var TW3NamedAnimation = {
   $ClassName:"TW3NamedAnimation",
   $Parent:TW3CustomAnimation
   ,$Init:function ($) {
      TW3CustomAnimation.$Init($);
      $.FName$2 = "";
   }
   /// procedure TW3NamedAnimation.SetupTransition()
   ///  [line: 367, column: 29, file: SmartCL.Effects]
   ,SetupTransition:function(Self) {
      var mCommand = "";
      TW3CustomAnimation.SetupTransition(Self);
      w3_setStyle(Self.FTarget$1.FHandle,w3_CSSPrefix("AnimationFillMode"),"both");
      mCommand = Self.FName$2+" "+FloatToStr$_Float_(Self.FDuration)+"s linear";
      w3_setStyle(Self.FTarget$1.FHandle,w3_CSSPrefix("Animation"),mCommand);
   }
   /// procedure TW3NamedAnimation.FinalizeTransition()
   ///  [line: 377, column: 29, file: SmartCL.Effects]
   ,FinalizeTransition:function(Self) {
      TW3CustomAnimation.FinalizeTransition(Self);
      if (Self.FTarget$1!==null) {
         Self.FTarget$1.FHandle.style[w3_CSSPrefix("Animation")] = "none";
         Self.FTarget$1.FHandle.style[w3_CSSPrefix("AnimationFillMode")] = "none";
      }
   }
   ,Destroy:TW3CustomAnimation.Destroy
   ,Create$42:TW3CustomAnimation.Create$42
   ,FinalizeTransition$:function($){return $.ClassType.FinalizeTransition($)}
   ,SetupTransition$:function($){return $.ClassType.SetupTransition($)}
};
/// TW3AnimationTiming enumeration
///  [line: 83, column: 3, file: SmartCL.Effects]
var TW3AnimationTiming = [ "atEase", "atLinear", "atEaseIn", "atEaseOut", "atEaseInOut" ];
var cW3AnimationTiming = ["ease","linear","ease-in","ease-out","ease-in-out"];
/// TW3AlertResult enumeration
///  [line: 27, column: 3, file: SmartCL.Dialogs]
var TW3AlertResult = [ "roYes", "roNo", "roOK", "roCancel" ];
/// TW3AlertOptions enumeration
///  [line: 26, column: 3, file: SmartCL.Dialogs]
var TW3AlertOptions = [ "aoYes", "aoNo", "aoYesNo", "aoOK", "aoCancel", "aoOKCancel" ];
/// TW3AlertDialog = class (TW3CustomControl)
///  [line: 38, column: 3, file: SmartCL.Dialogs]
var TW3AlertDialog = {
   $ClassName:"TW3AlertDialog",
   $Parent:TW3CustomControl
   ,$Init:function ($) {
      TW3CustomControl.$Init($);
      $.FNo = $.FOnSelect = $.FText = $.FTitle = $.FYes = null;
      $.FOptions = 0;
      $.FReady = false;
   }
   /// procedure TW3AlertDialog.FinalizeObject()
   ///  [line: 87, column: 26, file: SmartCL.Dialogs]
   ,FinalizeObject:function(Self) {
      TObject.Free(Self.FTitle);
      TObject.Free(Self.FText);
      TObject.Free(Self.FYes);
      TObject.Free(Self.FNo);
      TW3CustomControl.FinalizeObject(Self);
   }
   /// procedure TW3AlertDialog.HandleNoClick(Sender: TObject)
   ///  [line: 112, column: 26, file: SmartCL.Dialogs]
   ,HandleNoClick:function(Self, Sender$2) {
      if (Self.FOnSelect) {
         switch (Self.FOptions) {
            case 0 :
            case 2 :
            case 1 :
               Self.FOnSelect(Self,1);
               break;
            case 3 :
            case 4 :
            case 5 :
               Self.FOnSelect(Self,3);
               break;
         }
      }
   }
   /// procedure TW3AlertDialog.HandleYesClick(Sender: TObject)
   ///  [line: 101, column: 26, file: SmartCL.Dialogs]
   ,HandleYesClick:function(Self, Sender$3) {
      if (Self.FOnSelect) {
         switch (Self.FOptions) {
            case 0 :
            case 2 :
            case 1 :
               Self.FOnSelect(Self,0);
               break;
            case 3 :
            case 4 :
            case 5 :
               Self.FOnSelect(Self,2);
               break;
         }
      }
   }
   /// procedure TW3AlertDialog.InitializeObject()
   ///  [line: 68, column: 26, file: SmartCL.Dialogs]
   ,InitializeObject:function(Self) {
      TW3CustomControl.InitializeObject(Self);
      Self.FYes = TW3Component.Create$18$($New(TW3AlertButton),Self);
      TW3MovableControl.SetSize(Self.FYes,120,42);
      TW3Button.SetCaption(Self.FYes,"OK");
      TW3CustomControl._setMouseClick(Self.FYes,$Event1(Self,TW3AlertDialog.HandleYesClick));
      TW3MovableControl.SetVisible(Self.FYes,false);
      Self.FNo = TW3Component.Create$18$($New(TW3AlertButton),Self);
      TW3MovableControl.SetSize(Self.FNo,120,42);
      TW3Button.SetCaption(Self.FNo,"Cancel");
      TW3CustomControl._setMouseClick(Self.FNo,$Event1(Self,TW3AlertDialog.HandleNoClick));
      TW3MovableControl.SetVisible(Self.FNo,false);
      Self.FTitle = TW3Component.Create$18$($New(TW3Label),Self);
      Self.FText = TW3Component.Create$18$($New(TW3Label),Self);
   }
   /// procedure TW3AlertDialog.Resize()
   ///  [line: 194, column: 26, file: SmartCL.Dialogs]
   ,Resize:function(Self) {
      var hd$2 = 0;
      var wd$2 = 0;
      var dx$3 = 0;
      var dy$4 = 0;
      TW3MovableControl.Resize(Self);
      wd$2 = TW3ScrollInfo.GetScrollWidth(TW3CustomControl.GetScrollInfo(Self));
      hd$2 = TW3ScrollInfo.GetScrollHeight(TW3CustomControl.GetScrollInfo(Self));
      TW3MovableControl.SetBounds$2(Self.FTitle,8,8,wd$2-(8*2),32);
      TW3MovableControl.SetBounds$2(Self.FText,8,TW3MovableControl.GetTop(Self.FTitle)+TW3MovableControl.GetHeight$(Self.FTitle)+2,wd$2-(8*2),100-8);
      if (Self.FObjReady&&Self.FReady) {
         (wd$2-= (8*2));
         if (((Self.FOptions==2)||(Self.FOptions==5))) {
            (wd$2-= 8);
         }
         if (((Self.FOptions==0)||(Self.FOptions==3)||(Self.FOptions==1)||(Self.FOptions==4))) {
            if (((Self.FOptions==0)||(Self.FOptions==3))) {
               dy$4 = TW3MovableControl.GetHeight$(Self)-(TW3MovableControl.GetHeight$(Self.FYes)+20);
               TW3MovableControl.SetBounds$2(Self.FYes,10,dy$4,wd$2,TW3MovableControl.GetHeight$(Self.FYes));
            } else if (((Self.FOptions==1)||(Self.FOptions==4))) {
               dy$4 = TW3MovableControl.GetHeight$(Self)-(TW3MovableControl.GetHeight$(Self.FNo)+20);
               TW3MovableControl.SetBounds$2(Self.FNo,10,dy$4,wd$2,TW3MovableControl.GetHeight$(Self.FNo));
            }
         } else if (((Self.FOptions==2)||(Self.FOptions==5))) {
            dy$4 = hd$2-(TW3MovableControl.GetHeight$(Self.FYes)+8);
            TW3MovableControl.SetBounds$2(Self.FYes,8,dy$4,$Div(wd$2,2),TW3MovableControl.GetHeight$(Self.FYes));
            dx$3 = TW3ScrollInfo.GetScrollWidth(TW3CustomControl.GetScrollInfo(Self))-($Div(wd$2,2));
            (dx$3-= 8);
            TW3MovableControl.SetBounds$2(Self.FNo,dx$3,dy$4,$Div(wd$2,2),TW3MovableControl.GetHeight$(Self.FNo));
         }
      }
   }
   /// procedure TW3AlertDialog.SetupDialog(aTitle: String; aText: String; aOptions: TW3AlertOptions)
   ///  [line: 123, column: 26, file: SmartCL.Dialogs]
   ,SetupDialog:function(Self, aTitle, aText$2, aOptions) {
      if (!Self.FReady) {
         TW3TagObj.BeginUpdate(Self);
         try {
            Self.FOptions = aOptions;
            TW3Label.SetCaption$1(Self.FTitle,aTitle);
            TW3Label.SetCaption$1(Self.FText,aText$2);
            switch (Self.FOptions) {
               case 0 :
               case 3 :
                  TW3MovableControl.SetVisible(Self.FYes,true);
                  TW3MovableControl.SetVisible(Self.FNo,false);
                  break;
               case 1 :
               case 4 :
                  TW3MovableControl.SetVisible(Self.FNo,true);
                  TW3MovableControl.SetVisible(Self.FYes,false);
                  break;
               case 2 :
               case 5 :
                  TW3MovableControl.SetVisible(Self.FYes,true);
                  TW3MovableControl.SetVisible(Self.FNo,true);
                  break;
            }
            switch (Self.FOptions) {
               case 0 :
                  TW3Button.SetCaption(Self.FYes,"Yes");
                  break;
               case 1 :
                  TW3Button.SetCaption(Self.FNo,"No");
                  break;
               case 3 :
                  TW3Button.SetCaption(Self.FYes,"OK");
                  break;
               case 4 :
                  TW3Button.SetCaption(Self.FNo,"Cancel");
                  break;
               case 2 :
                  TW3Button.SetCaption(Self.FYes,"Yes");
                  TW3Button.SetCaption(Self.FNo,"No");
                  break;
               case 5 :
                  TW3Button.SetCaption(Self.FYes,"OK");
                  TW3Button.SetCaption(Self.FNo,"Cancel");
                  break;
            }
            TW3CustomFont.SetName$1(TW3CustomControl.GetFont(Self.FTitle),"Helvetica, Arial, sans-serif");
            TW3CustomFont.SetWeight(TW3CustomControl.GetFont(Self.FTitle),"bold");
            TW3CustomFont.SetSize$5(TW3CustomControl.GetFont(Self.FTitle),24);
            TW3Label.SetTextAlign$1(Self.FTitle,1);
            TW3CustomFont.SetColor$2(TW3CustomControl.GetFont(Self.FTitle),16777215);
            Self.FTitle.FContainer.FHandle.style["text-shadow"] = "0 -1px 0 rgba(0,0,0,.8)";
            TW3CustomFont.SetSize$5(TW3CustomControl.GetFont(Self.FText),16);
            TW3CustomFont.SetName$1(TW3CustomControl.GetFont(Self.FText),"Helvetica, Arial, sans-serif");
            TW3Label.SetTextAlign$1(Self.FText,1);
            Self.FReady = true;
         } finally {
            TW3MovableControl.SetWasSized(Self);
            TW3MovableControl.SetWasMoved(Self);
            TW3TagObj.EndUpdate(Self);
         }
      }
   }
   /// procedure TW3AlertDialog.StyleTagObject()
   ///  [line: 96, column: 26, file: SmartCL.Dialogs]
   ,StyleTagObject:function(Self) {
      TW3CustomControl.StyleTagObject(Self);
   }
   ,Destroy:TW3TagObj.Destroy
   ,AfterUpdate:TW3CustomControl.AfterUpdate
   ,FinalizeObject$:function($){return $.ClassType.FinalizeObject($)}
   ,InitializeObject$:function($){return $.ClassType.InitializeObject($)}
   ,MakeElementTagId:TW3TagObj.MakeElementTagId
   ,MakeElementTagObj:TW3TagObj.MakeElementTagObj
   ,StyleTagObject$:function($){return $.ClassType.StyleTagObject($)}
   ,ChildAdded:TW3Component.ChildAdded
   ,Create$18:TW3CustomControl.Create$18
   ,GetHeight:TW3MovableControl.GetHeight
   ,GetWidth:TW3MovableControl.GetWidth
   ,Resize$:function($){return $.ClassType.Resize($)}
   ,SetHeight:TW3MovableControl.SetHeight
   ,SetWidth:TW3MovableControl.SetWidth
   ,supportAdjustment:TW3MovableControl.supportAdjustment
   ,CBClick:TW3CustomControl.CBClick
   ,CBKeyDown:TW3CustomControl.CBKeyDown
   ,CBKeyUp:TW3CustomControl.CBKeyUp
   ,CBMouseDown:TW3CustomControl.CBMouseDown
   ,CBMouseMove:TW3CustomControl.CBMouseMove
   ,CBMouseUp:TW3CustomControl.CBMouseUp
   ,GetEnabled:TW3CustomControl.GetEnabled
   ,Invalidate:TW3CustomControl.Invalidate
   ,SetEnabled:TW3CustomControl.SetEnabled
};
TW3AlertDialog.$Intf={
   IW3AlertDialog:[TW3AlertDialog.SetupDialog]
}
/// TW3Button = class (TW3CustomControl)
///  [line: 18, column: 3, file: SmartCL.Controls.Button]
var TW3Button = {
   $ClassName:"TW3Button",
   $Parent:TW3CustomControl
   ,$Init:function ($) {
      TW3CustomControl.$Init($);
      $.FIgnoreMouse = 0;
      $.FPressed = false;
      $.FTouchEnd = null;
      $.FTouchMove = null;
      $.FTouchX = $.FTouchY = 0;
   }
   /// procedure TW3Button.CBClick(eventObj: JEvent)
   ///  [line: 165, column: 21, file: SmartCL.Controls.Button]
   ,CBClick:function(Self, eventObj$18) {
      if (Self.FPressed) {
         TW3Button.ResetClick(Self);
         TW3CustomControl.CBClick(Self,eventObj$18);
      } else {
         TW3Button.ResetClick(Self);
      }
   }
   /// procedure TW3Button.CBKeyDown(eventObj: JKeyboardEvent)
   ///  [line: 173, column: 21, file: SmartCL.Controls.Button]
   ,CBKeyDown:function(Self, eventObj$19) {
      TW3CustomControl.CBKeyDown(Self,eventObj$19);
      if (TW3CustomControl.GetEnabled$(Self)&&((eventObj$19.keyCode==13)||(eventObj$19.keyCode==32))) {
         TW3Button.SetPressed(Self,true);
      }
   }
   /// procedure TW3Button.CBKeyUp(eventObj: JKeyboardEvent)
   ///  [line: 180, column: 21, file: SmartCL.Controls.Button]
   ,CBKeyUp:function(Self, eventObj$20) {
      TW3CustomControl.CBKeyDown(Self,eventObj$20);
      switch (eventObj$20.keyCode) {
         case 13 :
         case 32 :
            if (TW3CustomControl.GetEnabled$(Self)&&Self.FPressed) {
               TW3CustomControl.CBClick$(Self,eventObj$20);
            }
            break;
         case 27 :
            TW3Button.SetPressed(Self,false);
            break;
      }
   }
   /// procedure TW3Button.CBMouseDown(eventObj: JMouseEvent)
   ///  [line: 141, column: 21, file: SmartCL.Controls.Button]
   ,CBMouseDown:function(Self, eventObj$21) {
      TW3CustomControl.CBMouseDown(Self,eventObj$21);
      if (PerformanceTimer.Now$1()<Self.FIgnoreMouse) {
         return;
      }
      if (TW3CustomControl.GetEnabled$(Self)&&(eventObj$21.button==0)) {
         TW3Button.SetPressed(Self,true);
         TW3CustomControl.SetCapture(Self);
      }
   }
   /// procedure TW3Button.CBMouseMove(eventObj: JMouseEvent)
   ///  [line: 158, column: 21, file: SmartCL.Controls.Button]
   ,CBMouseMove:function(Self, eventObj$22) {
      TW3CustomControl.CBMouseMove(Self,eventObj$22);
      if (TW3CustomControl.a$2(Self)) {
         TW3Button.SetPressed(Self,TRect$ContainsPos$1(TW3MovableControl.ScreenRect(Self),eventObj$22.clientX,eventObj$22.clientY));
      }
   }
   /// procedure TW3Button.CBMouseUp(eventObj: JMouseEvent)
   ///  [line: 151, column: 21, file: SmartCL.Controls.Button]
   ,CBMouseUp:function(Self, eventObj$23) {
      TW3CustomControl.CBMouseUp(Self,eventObj$23);
      if (TW3CustomControl.a$2(Self)&&(eventObj$23.button==0)) {
         TW3CustomControl.CBClick$(Self,eventObj$23);
      }
   }
   /// function TW3Button.GetCaption() : String
   ///  [line: 58, column: 20, file: SmartCL.Controls.Button]
   ,GetCaption:function(Self) {
      var Result = "";
      if (Self.FHandle) {
         Result = ""+Self.FHandle.innerHTML;
      }
      return Result
   }
   /// procedure TW3Button.InitializeObject()
   ///  [line: 70, column: 21, file: SmartCL.Controls.Button]
   ,InitializeObject:function(Self) {
      TW3CustomControl.InitializeObject(Self);
      TW3MovableControl.SetWidth$(Self,100);
      TW3MovableControl.SetHeight$(Self,32);
      Self.FHandle.addEventListener("touchstart",function (e$9) {
         var t = null;
         if (!TW3CustomControl.GetEnabled$(Self)) {
            return;
         }
         if (Self.FPressed) {
            return;
         }
         TW3Button.SetPressed(Self,true);
         e$9.stopPropagation();
         Self.FHandle.addEventListener("touchmove",Self.FTouchMove,false);
         document.body.addEventListener("touchend",Self.FTouchEnd,false);
         t = e$9.touches[0];
         Self.FTouchX = t.clientX;
         Self.FTouchY = t.clientY;
      },false);
      Self.FTouchMove = function (e$10) {
         var t$1 = null;
         t$1 = e$10.touches[0];
         if ((Math.abs(t$1.clientX-Self.FTouchX)>10)||(Math.abs(t$1.clientY-Self.FTouchY)>10)) {
            TW3Button.ResetClick(Self);
         }
      };
      Self.FTouchEnd = function (e$11) {
         TW3CustomControl.CBClick$(Self,e$11);
         Self.FIgnoreMouse = PerformanceTimer.Now$1()+1000;
      };
      TW3CustomControl._setMouseDown(Self,null);
      TW3CustomControl._setMouseUp(Self,null);
      TW3CustomControl._setMouseMove(Self,null);
      TW3CustomControl._setKeyDown(Self,null);
      TW3CustomControl._setKeyUp(Self,null);
   }
   /// function TW3Button.MakeElementTagObj() : THandle
   ///  [line: 115, column: 20, file: SmartCL.Controls.Button]
   ,MakeElementTagObj:function(Self) {
      var Result = undefined;
      Result = w3_createHtmlElement("button");
      return Result
   }
   /// procedure TW3Button.ResetClick()
   ///  [line: 130, column: 21, file: SmartCL.Controls.Button]
   ,ResetClick:function(Self) {
      TW3Button.SetPressed(Self,false);
      if (TW3CustomControl.a$2(Self)) {
         TW3CustomControl.ReleaseCapture(Self);
      } else {
         Self.FHandle.removeEventListener("touchmove",Self.FTouchMove,false);
         document.body.removeEventListener("touchend",Self.FTouchEnd,false);
      }
   }
   /// procedure TW3Button.SetCaption(Value: String)
   ///  [line: 64, column: 21, file: SmartCL.Controls.Button]
   ,SetCaption:function(Self, Value$12) {
      if (Self.FHandle) {
         Self.FHandle.innerHTML = Value$12;
      }
   }
   /// procedure TW3Button.SetPressed(value: Boolean)
   ///  [line: 120, column: 21, file: SmartCL.Controls.Button]
   ,SetPressed:function(Self, value$5) {
      if (Self.FPressed!=value$5) {
         Self.FPressed = value$5;
         if (value$5) {
            w3_AddClass(Self.FHandle,PressedCSSClass);
         } else {
            w3_RemoveClass(Self.FHandle,PressedCSSClass);
         }
      }
   }
   ,Destroy:TW3TagObj.Destroy
   ,AfterUpdate:TW3CustomControl.AfterUpdate
   ,FinalizeObject:TW3CustomControl.FinalizeObject
   ,InitializeObject$:function($){return $.ClassType.InitializeObject($)}
   ,MakeElementTagId:TW3TagObj.MakeElementTagId
   ,MakeElementTagObj$:function($){return $.ClassType.MakeElementTagObj($)}
   ,StyleTagObject:TW3CustomControl.StyleTagObject
   ,ChildAdded:TW3Component.ChildAdded
   ,Create$18:TW3CustomControl.Create$18
   ,GetHeight:TW3MovableControl.GetHeight
   ,GetWidth:TW3MovableControl.GetWidth
   ,Resize:TW3MovableControl.Resize
   ,SetHeight:TW3MovableControl.SetHeight
   ,SetWidth:TW3MovableControl.SetWidth
   ,supportAdjustment:TW3MovableControl.supportAdjustment
   ,CBClick$:function($){return $.ClassType.CBClick.apply($.ClassType, arguments)}
   ,CBKeyDown$:function($){return $.ClassType.CBKeyDown.apply($.ClassType, arguments)}
   ,CBKeyUp$:function($){return $.ClassType.CBKeyUp.apply($.ClassType, arguments)}
   ,CBMouseDown$:function($){return $.ClassType.CBMouseDown.apply($.ClassType, arguments)}
   ,CBMouseMove$:function($){return $.ClassType.CBMouseMove.apply($.ClassType, arguments)}
   ,CBMouseUp$:function($){return $.ClassType.CBMouseUp.apply($.ClassType, arguments)}
   ,GetEnabled:TW3CustomControl.GetEnabled
   ,Invalidate:TW3CustomControl.Invalidate
   ,SetEnabled:TW3CustomControl.SetEnabled
};
/// TW3AlertButton = class (TW3Button)
///  [line: 31, column: 3, file: SmartCL.Dialogs]
var TW3AlertButton = {
   $ClassName:"TW3AlertButton",
   $Parent:TW3Button
   ,$Init:function ($) {
      TW3Button.$Init($);
   }
   ,Destroy:TW3TagObj.Destroy
   ,AfterUpdate:TW3CustomControl.AfterUpdate
   ,FinalizeObject:TW3CustomControl.FinalizeObject
   ,InitializeObject:TW3Button.InitializeObject
   ,MakeElementTagId:TW3TagObj.MakeElementTagId
   ,MakeElementTagObj:TW3Button.MakeElementTagObj
   ,StyleTagObject:TW3CustomControl.StyleTagObject
   ,ChildAdded:TW3Component.ChildAdded
   ,Create$18:TW3CustomControl.Create$18
   ,GetHeight:TW3MovableControl.GetHeight
   ,GetWidth:TW3MovableControl.GetWidth
   ,Resize:TW3MovableControl.Resize
   ,SetHeight:TW3MovableControl.SetHeight
   ,SetWidth:TW3MovableControl.SetWidth
   ,supportAdjustment:TW3MovableControl.supportAdjustment
   ,CBClick:TW3Button.CBClick
   ,CBKeyDown:TW3Button.CBKeyDown
   ,CBKeyUp:TW3Button.CBKeyUp
   ,CBMouseDown:TW3Button.CBMouseDown
   ,CBMouseMove:TW3Button.CBMouseMove
   ,CBMouseUp:TW3Button.CBMouseUp
   ,GetEnabled:TW3CustomControl.GetEnabled
   ,Invalidate:TW3CustomControl.Invalidate
   ,SetEnabled:TW3CustomControl.SetEnabled
};
/// TW3LabelText = class (TW3CustomControl)
///  [line: 19, column: 3, file: SmartCL.Controls.Label]
var TW3LabelText = {
   $ClassName:"TW3LabelText",
   $Parent:TW3CustomControl
   ,$Init:function ($) {
      TW3CustomControl.$Init($);
   }
   ,Destroy:TW3TagObj.Destroy
   ,AfterUpdate:TW3CustomControl.AfterUpdate
   ,FinalizeObject:TW3CustomControl.FinalizeObject
   ,InitializeObject:TW3CustomControl.InitializeObject
   ,MakeElementTagId:TW3TagObj.MakeElementTagId
   ,MakeElementTagObj:TW3TagObj.MakeElementTagObj
   ,StyleTagObject:TW3CustomControl.StyleTagObject
   ,ChildAdded:TW3Component.ChildAdded
   ,Create$18:TW3CustomControl.Create$18
   ,GetHeight:TW3MovableControl.GetHeight
   ,GetWidth:TW3MovableControl.GetWidth
   ,Resize:TW3MovableControl.Resize
   ,SetHeight:TW3MovableControl.SetHeight
   ,SetWidth:TW3MovableControl.SetWidth
   ,supportAdjustment:TW3MovableControl.supportAdjustment
   ,CBClick:TW3CustomControl.CBClick
   ,CBKeyDown:TW3CustomControl.CBKeyDown
   ,CBKeyUp:TW3CustomControl.CBKeyUp
   ,CBMouseDown:TW3CustomControl.CBMouseDown
   ,CBMouseMove:TW3CustomControl.CBMouseMove
   ,CBMouseUp:TW3CustomControl.CBMouseUp
   ,GetEnabled:TW3CustomControl.GetEnabled
   ,Invalidate:TW3CustomControl.Invalidate
   ,SetEnabled:TW3CustomControl.SetEnabled
};
/// TW3Label = class (TW3CustomControl)
///  [line: 22, column: 3, file: SmartCL.Controls.Label]
var TW3Label = {
   $ClassName:"TW3Label",
   $Parent:TW3CustomControl
   ,$Init:function ($) {
      TW3CustomControl.$Init($);
      $.FCaption$1 = "";
      $.FContainer = null;
      $.FTextAlign = 0;
   }
   /// procedure TW3Label.FinalizeObject()
   ///  [line: 66, column: 20, file: SmartCL.Controls.Label]
   ,FinalizeObject:function(Self) {
      TObject.Free(Self.FContainer);
      TW3CustomControl.FinalizeObject(Self);
   }
   /// procedure TW3Label.InitializeObject()
   ///  [line: 51, column: 20, file: SmartCL.Controls.Label]
   ,InitializeObject:function(Self) {
      TW3CustomControl.InitializeObject(Self);
      Self.FContainer = TW3Component.Create$18$($New(TW3LabelText),Self);
      w3_setCssStyle(Self.FContainer.FHandle,"text-overflow","ellipsis");
      w3_setCssStyle(Self.FContainer.FHandle,w3_CSSPrefixDef("text-overflow"),"ellipsis");
      w3_setCssStyle(Self.FContainer.FHandle,"white-space","nowrap");
      w3_setCssStyle(Self.FContainer.FHandle,"overflow","hidden");
      w3_setCssStyle(Self.FContainer.FHandle,w3_CSSPrefixDef("vertical-align"),"middle");
      TW3Label.SetCaption$1(Self,"Label");
      TW3MovableControl.SetHeight$(Self,12);
   }
   /// function TW3Label.MakeElementTagObj() : THandle
   ///  [line: 77, column: 19, file: SmartCL.Controls.Label]
   ,MakeElementTagObj:function(Self) {
      var Result = undefined;
      Result = w3_createHtmlElement("fieldset");
      return Result
   }
   /// procedure TW3Label.Resize()
   ///  [line: 82, column: 20, file: SmartCL.Controls.Label]
   ,Resize:function(Self) {
      var dx$4 = 0;
      var dy$5 = 0;
      var wd$3 = 0;
      var hd$3 = 0;
      TW3MovableControl.Resize(Self);
      TW3TagObj.BeginUpdate(Self.FContainer);
      TW3MovableControl.SetBounds$2(Self.FContainer,0,0,2,2);
      wd$3 = ClampInt(TW3ScrollInfo.GetScrollWidth(TW3CustomControl.GetScrollInfo(Self.FContainer))+2,0,TW3MovableControl.ClientWidth(Self));
      hd$3 = ClampInt(TW3ScrollInfo.GetScrollHeight(TW3CustomControl.GetScrollInfo(Self.FContainer)),0,TW3MovableControl.ClientHeight(Self));
      switch (Self.FTextAlign) {
         case 0 :
            dy$5 = ($Div(TW3MovableControl.ClientHeight(Self),2))-($Div(hd$3,2));
            TW3MovableControl.SetBounds$2(Self.FContainer,0,dy$5,wd$3,hd$3);
            break;
         case 1 :
            dx$4 = ($Div(TW3MovableControl.ClientWidth(Self),2))-($Div(wd$3,2));
            dy$5 = ($Div(TW3MovableControl.ClientHeight(Self),2))-($Div(hd$3,2));
            TW3MovableControl.SetBounds$2(Self.FContainer,dx$4,dy$5,wd$3,hd$3);
            break;
         case 2 :
            dx$4 = TW3MovableControl.ClientWidth(Self)-wd$3;
            dy$5 = ($Div(TW3MovableControl.ClientHeight(Self),2))-($Div(hd$3,2));
            TW3MovableControl.SetBounds$2(Self.FContainer,dx$4,dy$5,wd$3,hd$3);
            break;
      }
      TW3TagObj.EndUpdate(Self.FContainer);
   }
   /// procedure TW3Label.SetCaption(const aValue: String)
   ///  [line: 117, column: 20, file: SmartCL.Controls.Label]
   ,SetCaption$1:function(Self, aValue$60) {
      if (aValue$60!=Self.FCaption$1) {
         TW3TagObj.BeginUpdate(Self);
         Self.FCaption$1 = aValue$60;
         TW3TagObj.SetInnerHTML(Self.FContainer,aValue$60);
         TW3MovableControl.SetWasSized(Self);
         TW3MovableControl.SetWasMoved(Self);
         TW3TagObj.EndUpdate(Self);
      }
   }
   /// procedure TW3Label.SetEnabled(aValue: Boolean)
   ///  [line: 130, column: 20, file: SmartCL.Controls.Label]
   ,SetEnabled:function(Self, aValue$61) {
      TW3CustomControl.SetEnabled(Self,aValue$61);
      TW3CustomControl.SetEnabled$(Self.FContainer,aValue$61);
   }
   /// procedure TW3Label.SetTextAlign(aNewAlignment: TTextAlign)
   ///  [line: 136, column: 20, file: SmartCL.Controls.Label]
   ,SetTextAlign$1:function(Self, aNewAlignment) {
      var AlignmentText = "";
      TW3TagObj.BeginUpdate(Self);
      Self.FTextAlign = aNewAlignment;
      switch (aNewAlignment) {
         case 0 :
            AlignmentText = "left";
            break;
         case 1 :
            AlignmentText = "center";
            break;
         case 2 :
            AlignmentText = "right";
            break;
      }
      w3_setCssStyle(Self.FContainer.FHandle,"text-align",AlignmentText);
      TW3MovableControl.SetWasSized(Self);
      TW3MovableControl.SetWasMoved(Self);
      TW3TagObj.EndUpdate(Self);
   }
   /// function TW3Label.SupportAdjustment() : Boolean
   ///  [line: 72, column: 25, file: SmartCL.Controls.Label]
   ,supportAdjustment:function(Self) {
      var Result = false;
      Result = false;
      return Result
   }
   ,Destroy:TW3TagObj.Destroy
   ,AfterUpdate:TW3CustomControl.AfterUpdate
   ,FinalizeObject$:function($){return $.ClassType.FinalizeObject($)}
   ,InitializeObject$:function($){return $.ClassType.InitializeObject($)}
   ,MakeElementTagId:TW3TagObj.MakeElementTagId
   ,MakeElementTagObj$:function($){return $.ClassType.MakeElementTagObj($)}
   ,StyleTagObject:TW3CustomControl.StyleTagObject
   ,ChildAdded:TW3Component.ChildAdded
   ,Create$18:TW3CustomControl.Create$18
   ,GetHeight:TW3MovableControl.GetHeight
   ,GetWidth:TW3MovableControl.GetWidth
   ,Resize$:function($){return $.ClassType.Resize($)}
   ,SetHeight:TW3MovableControl.SetHeight
   ,SetWidth:TW3MovableControl.SetWidth
   ,supportAdjustment$:function($){return $.supportAdjustment($)}
   ,CBClick:TW3CustomControl.CBClick
   ,CBKeyDown:TW3CustomControl.CBKeyDown
   ,CBKeyUp:TW3CustomControl.CBKeyUp
   ,CBMouseDown:TW3CustomControl.CBMouseDown
   ,CBMouseMove:TW3CustomControl.CBMouseMove
   ,CBMouseUp:TW3CustomControl.CBMouseUp
   ,GetEnabled:TW3CustomControl.GetEnabled
   ,Invalidate:TW3CustomControl.Invalidate
   ,SetEnabled$:function($){return $.ClassType.SetEnabled.apply($.ClassType, arguments)}
};
/// TTextAlign enumeration
///  [line: 17, column: 3, file: SmartCL.Controls.Label]
var TTextAlign = [ "taLeft", "taCenter", "taRight" ];
/// PerformanceTimer = class (TObject)
///  [line: 15, column: 3, file: System.Diagnostics]
var PerformanceTimer = {
   $ClassName:"PerformanceTimer",
   $Parent:TObject
   ,$Init:function ($) {
      TObject.$Init($);
   }
   /// procedure PerformanceTimer.PrepareGetNow()
   ///  [line: 56, column: 34, file: System.Diagnostics]
   ,PrepareGetNow:function() {
      
    if (window.performance && performance.now) {
      vGetNow = performance;
      vIsHighResolution = true;
    } else {
      vIsHighResolution = false;
      if (!Date.now) { Date.now = function (){ return +(new Date) } };
      vGetNow = Date;
    }
     }
   /// function PerformanceTimer.Now() : Float
   ///  [line: 49, column: 33, file: System.Diagnostics]
   ,Now$1:function() {
      var Result = 0;
      if (!vGetNow) {
         PerformanceTimer.PrepareGetNow();
      }
      Result = Number(vGetNow.now());
      return Result
   }
   ,Destroy:TObject.Destroy
};
/// TPaintBoxForm = class (TW3Form)
///  [line: 10, column: 3, file: Main]
var TPaintBoxForm = {
   $ClassName:"TPaintBoxForm",
   $Parent:TW3Form
   ,$Init:function ($) {
      TW3Form.$Init($);
      $.FCanvas$1 = null;
      $.FTextPos = 0;
   }
   /// procedure TPaintBoxForm.FinalizeObject()
   ///  [line: 32, column: 25, file: Main]
   ,FinalizeObject:function(Self) {
      TObject.Free(Self.FCanvas$1);
      TW3CustomControl.FinalizeObject(Self);
   }
   /// procedure TPaintBoxForm.HandleTouchBegins(Sender: TObject; info: TW3TouchData)
   ///  [line: 49, column: 25, file: Main]
   ,HandleTouchBegins:function(Self, Sender$4, info$2) {
      TPaintBoxForm.ShowMessage$2(Self,"B "+TPaintBoxForm.TouchDataToStr(Self,info$2));
   }
   /// procedure TPaintBoxForm.HandleTouchEnds(Sender: TObject; info: TW3TouchData)
   ///  [line: 59, column: 25, file: Main]
   ,HandleTouchEnds:function(Self, Sender$5, info$3) {
      TPaintBoxForm.ShowMessage$2(Self,"E "+TPaintBoxForm.TouchDataToStr(Self,info$3));
   }
   /// procedure TPaintBoxForm.HandleTouchMoves(Sender: TObject; info: TW3TouchData)
   ///  [line: 54, column: 25, file: Main]
   ,HandleTouchMoves:function(Self, Sender$6, info$4) {
      TPaintBoxForm.ShowMessage$2(Self,"M "+TPaintBoxForm.TouchDataToStr(Self,info$4));
   }
   /// procedure TPaintBoxForm.InitializeObject()
   ///  [line: 38, column: 25, file: Main]
   ,InitializeObject:function(Self) {
      TW3CustomControl.InitializeObject(Self);
      Self.FTextPos = 12;
      Self.FCanvas$1 = TW3Component.Create$18$($New(TW3GraphicControl),Self);
      TW3CustomControl._setTouchBegins(Self.FCanvas$1,$Event2(Self,TPaintBoxForm.HandleTouchBegins));
      TW3CustomControl._setTouchMoves(Self.FCanvas$1,$Event2(Self,TPaintBoxForm.HandleTouchMoves));
      TW3CustomControl._setTouchEnds(Self.FCanvas$1,$Event2(Self,TPaintBoxForm.HandleTouchEnds));
      Self.FCanvas$1.FOnPaint = $Event2(Self,TPaintBoxForm.Paint$1);
   }
   /// procedure TPaintBoxForm.Paint(Sender: TObject; canvas: TW3Canvas)
   ///  [line: 64, column: 25, file: Main]
   ,Paint$1:function(Self, Sender$7, canvas$1) {
      TW3Canvas.SetFillStyle(canvas$1,"#FFFFFF");
      TW3Canvas.FillRectF$2(canvas$1,0,0,TW3MovableControl.GetWidth$(Self.FCanvas$1),TW3MovableControl.GetHeight$(Self.FCanvas$1));
   }
   /// procedure TPaintBoxForm.Resize()
   ///  [line: 70, column: 25, file: Main]
   ,Resize:function(Self) {
      TW3MovableControl.SetBounds$2(Self.FCanvas$1,0,0,TW3MovableControl.GetWidth$(Self),TW3MovableControl.GetHeight$(Self));
   }
   /// procedure TPaintBoxForm.ShowMessage(msg: String)
   ///  [line: 75, column: 25, file: Main]
   ,ShowMessage$2:function(Self, msg$1) {
      if (Self.FTextPos>(TW3MovableControl.GetHeight$(Self.FCanvas$1)-13)) {
         Self.FTextPos = 12;
         TW3CustomControl.Invalidate$(Self.FCanvas$1);
      }
      TW3Canvas.SetFillStyle(Self.FCanvas$1.FCanvas,"#000000");
      TW3Canvas.FillTextF(Self.FCanvas$1.FCanvas,msg$1,10,Self.FTextPos,TW3Canvas.MeasureText(Self.FCanvas$1.FCanvas,msg$1).Width$4);
      (Self.FTextPos+= 13);
   }
   /// procedure TPaintBoxForm.StyleTagObject()
   ///  [line: 86, column: 25, file: Main]
   ,StyleTagObject:function(Self) {
      TW3CustomForm.StyleTagObject(Self);
      TW3CustomControl.SetStyleClass(Self,"TW3CustomForm");
   }
   /// function TPaintBoxForm.TouchDataToStr(info: TW3TouchData) : String
   ///  [line: 92, column: 24, file: Main]
   ,TouchDataToStr:function(Self, info$5) {
      var Result = "";
      Result = "T: "+TPaintBoxForm.TouchListToStr(Self,TW3TouchData.GetTouches(info$5),true)+"; "+"M: "+TPaintBoxForm.TouchListToStr(Self,TW3TouchData.GetChanged(info$5),false);
      return Result
   }
   /// function TPaintBoxForm.TouchListToStr(list: TW3TouchList; shortLog: Boolean) : String
   ///  [line: 99, column: 24, file: Main]
   ,TouchListToStr:function(Self, list, shortLog) {
      var Result = "";
      var iTouch = 0;
      Result = "";
      var $temp26;
      for(iTouch = 0,$temp26 = TW3TouchList.a$24(list);iTouch<$temp26;iTouch++) {
         if (Result!="") {
            Result = Result+", ";
         }
         Result = Result+(TW3TouchList.a$25(list,iTouch).FIdent.toString()+":"+TW3TouchList.a$25(list,iTouch).FScreenX.toString()+","+TW3TouchList.a$25(list,iTouch).FScreenY.toString());
         if (!shortLog) {
            Result = Result+("/"+TW3TouchList.a$25(list,iTouch).FClientX.toString()+","+TW3TouchList.a$25(list,iTouch).FClientY.toString()+"/"+TW3TouchList.a$25(list,iTouch).FPageX.toString()+","+TW3TouchList.a$25(list,iTouch).FPageY.toString());
         }
      }
      return Result
   }
   ,Destroy:TW3CustomForm.Destroy
   ,AfterUpdate:TW3CustomControl.AfterUpdate
   ,FinalizeObject$:function($){return $.ClassType.FinalizeObject($)}
   ,InitializeObject$:function($){return $.ClassType.InitializeObject($)}
   ,MakeElementTagId:TW3TagObj.MakeElementTagId
   ,MakeElementTagObj:TW3TagObj.MakeElementTagObj
   ,StyleTagObject$:function($){return $.ClassType.StyleTagObject($)}
   ,ChildAdded:TW3Component.ChildAdded
   ,Create$18:TW3CustomForm.Create$18
   ,GetHeight:TW3MovableControl.GetHeight
   ,GetWidth:TW3MovableControl.GetWidth
   ,Resize$:function($){return $.ClassType.Resize($)}
   ,SetHeight:TW3MovableControl.SetHeight
   ,SetWidth:TW3MovableControl.SetWidth
   ,supportAdjustment:TW3MovableControl.supportAdjustment
   ,CBClick:TW3CustomControl.CBClick
   ,CBKeyDown:TW3CustomControl.CBKeyDown
   ,CBKeyUp:TW3CustomControl.CBKeyUp
   ,CBMouseDown:TW3CustomControl.CBMouseDown
   ,CBMouseMove:TW3CustomControl.CBMouseMove
   ,CBMouseUp:TW3CustomControl.CBMouseUp
   ,GetEnabled:TW3CustomControl.GetEnabled
   ,Invalidate:TW3CustomControl.Invalidate
   ,SetEnabled:TW3CustomControl.SetEnabled
};
/// TW3Panel = class (TW3CustomControl)
///  [line: 17, column: 3, file: SmartCL.Controls.Panel]
var TW3Panel = {
   $ClassName:"TW3Panel",
   $Parent:TW3CustomControl
   ,$Init:function ($) {
      TW3CustomControl.$Init($);
   }
   ,Destroy:TW3TagObj.Destroy
   ,AfterUpdate:TW3CustomControl.AfterUpdate
   ,FinalizeObject:TW3CustomControl.FinalizeObject
   ,InitializeObject:TW3CustomControl.InitializeObject
   ,MakeElementTagId:TW3TagObj.MakeElementTagId
   ,MakeElementTagObj:TW3TagObj.MakeElementTagObj
   ,StyleTagObject:TW3CustomControl.StyleTagObject
   ,ChildAdded:TW3Component.ChildAdded
   ,Create$18:TW3CustomControl.Create$18
   ,GetHeight:TW3MovableControl.GetHeight
   ,GetWidth:TW3MovableControl.GetWidth
   ,Resize:TW3MovableControl.Resize
   ,SetHeight:TW3MovableControl.SetHeight
   ,SetWidth:TW3MovableControl.SetWidth
   ,supportAdjustment:TW3MovableControl.supportAdjustment
   ,CBClick:TW3CustomControl.CBClick
   ,CBKeyDown:TW3CustomControl.CBKeyDown
   ,CBKeyUp:TW3CustomControl.CBKeyUp
   ,CBMouseDown:TW3CustomControl.CBMouseDown
   ,CBMouseMove:TW3CustomControl.CBMouseMove
   ,CBMouseUp:TW3CustomControl.CBMouseUp
   ,GetEnabled:TW3CustomControl.GetEnabled
   ,Invalidate:TW3CustomControl.Invalidate
   ,SetEnabled:TW3CustomControl.SetEnabled
};
/// TW3PaintBox = class (TW3GraphicControl)
///  [line: 17, column: 3, file: SmartCL.Controls.PaintBox]
var TW3PaintBox = {
   $ClassName:"TW3PaintBox",
   $Parent:TW3GraphicControl
   ,$Init:function ($) {
      TW3GraphicControl.$Init($);
   }
   ,Destroy:TW3TagObj.Destroy
   ,AfterUpdate:TW3CustomControl.AfterUpdate
   ,FinalizeObject:TW3GraphicControl.FinalizeObject
   ,InitializeObject:TW3GraphicControl.InitializeObject
   ,MakeElementTagId:TW3TagObj.MakeElementTagId
   ,MakeElementTagObj:TW3GraphicControl.MakeElementTagObj
   ,StyleTagObject:TW3CustomControl.StyleTagObject
   ,ChildAdded:TW3Component.ChildAdded
   ,Create$18:TW3CustomControl.Create$18
   ,GetHeight:TW3MovableControl.GetHeight
   ,GetWidth:TW3MovableControl.GetWidth
   ,Resize:TW3GraphicControl.Resize
   ,SetHeight:TW3GraphicControl.SetHeight
   ,SetWidth:TW3GraphicControl.SetWidth
   ,supportAdjustment:TW3MovableControl.supportAdjustment
   ,CBClick:TW3CustomControl.CBClick
   ,CBKeyDown:TW3CustomControl.CBKeyDown
   ,CBKeyUp:TW3CustomControl.CBKeyUp
   ,CBMouseDown:TW3CustomControl.CBMouseDown
   ,CBMouseMove:TW3CustomControl.CBMouseMove
   ,CBMouseUp:TW3CustomControl.CBMouseUp
   ,GetEnabled:TW3CustomControl.GetEnabled
   ,Invalidate:TW3GraphicControl.Invalidate
   ,SetEnabled:TW3CustomControl.SetEnabled
   ,Paint:TW3GraphicControl.Paint
};
/// TW3CustomRepeater = class (TObject)
///  [line: 32, column: 3, file: SmartCL.Time]
var TW3CustomRepeater = {
   $ClassName:"TW3CustomRepeater",
   $Parent:TObject
   ,$Init:function ($) {
      TObject.$Init($);
      $.FDelay$1 = 0;
      $.FHandle$5 = undefined;
   }
   /// procedure TW3CustomRepeater.AllocTimer()
   ///  [line: 196, column: 29, file: SmartCL.Time]
   ,AllocTimer:function(Self) {
      if (Self.FHandle$5!=0) {
         TW3CustomRepeater.ReleaseTimer(Self);
      }
      Self.FHandle$5 = setInterval($Event0(Self,TW3CustomRepeater.CBExecute$),(Self.FDelay$1));
   }
   /// destructor TW3CustomRepeater.Destroy()
   ///  [line: 178, column: 30, file: SmartCL.Time]
   ,Destroy:function(Self) {
      if (Self.FHandle$5!=0) {
         TW3CustomRepeater.ReleaseTimer(Self);
      }
      TObject.Destroy(Self);
   }
   /// procedure TW3CustomRepeater.ReleaseTimer()
   ///  [line: 205, column: 29, file: SmartCL.Time]
   ,ReleaseTimer:function(Self) {
      if (Self.FHandle$5!=0) {
         clearInterval(Self.FHandle$5);
         Self.FHandle$5 = 0;
      }
   }
   /// procedure TW3CustomRepeater.setDelay(aValue: Integer)
   ///  [line: 186, column: 29, file: SmartCL.Time]
   ,setDelay:function(Self, aValue$62) {
      Self.FDelay$1 = Math.max(aValue$62,1);
      if (Self.FHandle$5!=0) {
         TW3CustomRepeater.AllocTimer(Self);
      }
   }
   ,Destroy$:function($){return $.ClassType.Destroy($)}
   ,CBExecute$:function($){return $.ClassType.CBExecute($)}
};
/// TW3EventRepeater = class (TW3CustomRepeater)
///  [line: 49, column: 3, file: SmartCL.Time]
var TW3EventRepeater = {
   $ClassName:"TW3EventRepeater",
   $Parent:TW3CustomRepeater
   ,$Init:function ($) {
      TW3CustomRepeater.$Init($);
      $.FCallBack = null;
   }
   /// procedure TW3EventRepeater.CBExecute()
   ///  [line: 168, column: 28, file: SmartCL.Time]
   ,CBExecute:function(Self) {
      if (Self.FCallBack(Self)) {
         TW3CustomRepeater.ReleaseTimer(Self);
      }
   }
   /// constructor TW3EventRepeater.Create(aCallBack: TW3RepeaterEvent; aDelay: Integer)
   ///  [line: 145, column: 30, file: SmartCL.Time]
   ,Create$55:function(Self, aCallBack, aDelay) {
      TObject.Create(Self);
      Self.FCallBack = aCallBack;
      TW3CustomRepeater.setDelay(Self,aDelay);
      if ((aCallBack!==null)&&(aDelay>0)) {
         TW3CustomRepeater.AllocTimer(Self);
      }
      return Self
   }
   ,Destroy:TW3CustomRepeater.Destroy
   ,CBExecute$:function($){return $.ClassType.CBExecute($)}
};
/// TControlAnimationList = class (TObject)
///  [line: 75, column: 3, file: SmartCL.Animation]
var TControlAnimationList = {
   $ClassName:"TControlAnimationList",
   $Parent:TObject
   ,$Init:function ($) {
      TObject.$Init($);
      $.FAnimationList = $.FControl = null;
   }
   /// procedure TControlAnimationList.Animate(time_ms: Integer; animateProc: TAnimationStep; config: TAnimationConfig = nil)
   ///  [line: 372, column: 33, file: SmartCL.Animation]
   ,Animate:function(Self, time_ms, animateProc, config) {
      if ((config!==null)&&(config.FStart==0)) {
         TObjectList.Clear$2(Self.FAnimationList);
      }
      TObjectList.Add$1(Self.FAnimationList,TAnimation.Create$58($New(TAnimation),Self.FControl,time_ms,config,animateProc));
      if (TObjectList.GetCount$1(Self.FAnimationList)==1) {
         TAnimation.Start$2($As(TObjectList.GetItem$5(Self.FAnimationList,0),TAnimation),$Event1(Self,TControlAnimationList.MoveToNext));
      }
   }
   /// constructor TControlAnimationList.Create(ctrl: TW3CustomControl)
   ///  [line: 365, column: 35, file: SmartCL.Animation]
   ,Create$56:function(Self, ctrl) {
      TObject.Create(Self);
      Self.FAnimationList = TObjectList.Create$38($New(TObjectList));
      Self.FControl = ctrl;
      return Self
   }
   /// function TControlAnimationList.IsActive() : Boolean
   ///  [line: 387, column: 32, file: SmartCL.Animation]
   ,IsActive:function(Self) {
      var Result = false;
      Result = (TObjectList.GetCount$1(Self.FAnimationList)>0)&&(!$As(TObjectList.GetItem$5(Self.FAnimationList,0),TAnimation).FCompleted);
      return Result
   }
   /// procedure TControlAnimationList.Move(time_ms: Integer; X: Integer; Y: Integer; config: TAnimationConfig = nil)
   ///  [line: 392, column: 33, file: SmartCL.Animation]
   ,Move$3:function(Self, time_ms$1, X$2, Y$2, config$1) {
      TControlAnimationList.PrepareAnimation(Self,TMoveAnimation.Create$61($New(TMoveAnimation),Self.FControl,time_ms$1,config$1,Create$13(X$2,Y$2)),config$1);
   }
   /// procedure TControlAnimationList.MoveToNext(animation: TAnimation)
   ///  [line: 413, column: 33, file: SmartCL.Animation]
   ,MoveToNext:function(Self, animation) {
      var idx$1 = 0;
      var onCompleted = null;
      idx$1 = TObjectList.IndexOf$1(Self.FAnimationList,animation);
      TObjectList.Remove$1(Self.FAnimationList,idx$1);
      if ((animation.FConfig!==null)&&(animation.FConfig.FNotifyAtEnd!==null)) {
         onCompleted = animation.FConfig.FNotifyAtEnd;
         onCompleted();
      }
      TObject.Free(animation);
      if ((TObjectList.GetCount$1(Self.FAnimationList)>0)&&(!TAnimation.IsActive$1($As(TObjectList.GetItem$5(Self.FAnimationList,0),TAnimation)))) {
         TAnimation.Start$2($As(TObjectList.GetItem$5(Self.FAnimationList,0),TAnimation),$Event1(Self,TControlAnimationList.MoveToNext));
      }
   }
   /// procedure TControlAnimationList.PrepareAnimation(animation: TAnimation; config: TAnimationConfig)
   ///  [line: 440, column: 33, file: SmartCL.Animation]
   ,PrepareAnimation:function(Self, animation$1, config$2) {
      var idx$2 = 0;
      idx$2 = TObjectList.Add$1(Self.FAnimationList,animation$1);
      if ((!(config$2!==null))||(config$2.FStart==0)) {
         TAnimation.Start$2($As(TObjectList.GetItem$5(Self.FAnimationList,idx$2),TAnimation),$Event1(Self,TControlAnimationList.MoveToNext));
      }
   }
   ,Destroy:TObject.Destroy
};
/// TAnimationManager = class (TObject)
///  [line: 96, column: 3, file: SmartCL.Animation]
var TAnimationManager = {
   $ClassName:"TAnimationManager",
   $Parent:TObject
   ,$Init:function ($) {
      TObject.$Init($);
   }
   /// function TAnimationManager.HasAnimationList(ctrl: TW3CustomControl) : Boolean
   ///  [line: 490, column: 28, file: SmartCL.Animation]
   ,HasAnimationList:function(Self, ctrl$1) {
      var Result = false;
      
    Result = (ctrl$1).hasOwnProperty('AM_AL');
  return Result
   }
   /// function TAnimationManager.GetAnimationList(ctrl: TW3CustomControl) : TControlAnimationList
   ///  [line: 477, column: 28, file: SmartCL.Animation]
   ,GetAnimationList:function(Self, ctrl$2) {
      var Result = null;
      if (TAnimationManager.HasAnimationList(Self,ctrl$2)) {
         
    Result = (ctrl$2).AM_AL;
        } else {
         Result = TControlAnimationList.Create$56($New(TControlAnimationList),ctrl$2);
         
      (ctrl$2).AM_AL = Result;
          }
      return Result
   }
   /// function TAnimationManager.Config() : TAnimationConfig
   ///  [line: 472, column: 34, file: SmartCL.Animation]
   ,Config:function(Self) {
      var Result = null;
      Result = TAnimationConfig.Create$57($New(TAnimationConfig));
      return Result
   }
   ,Destroy:TObject.Destroy
};
/// TAnimationConfig = class (TObject)
///  [line: 32, column: 3, file: SmartCL.Animation]
var TAnimationConfig = {
   $ClassName:"TAnimationConfig",
   $Parent:TObject
   ,$Init:function ($) {
      TObject.$Init($);
      $.FLoop = false;
      $.FNotifyAtEnd = null;
      $.FStart = 0;
   }
   /// constructor TAnimationConfig.Create()
   ///  [line: 157, column: 30, file: SmartCL.Animation]
   ,Create$57:function(Self) {
      TObject.Create(Self);
      Self.FStart = 0;
      Self.FNotifyAtEnd = null;
      return Self
   }
   /// function TAnimationConfig.SetOnCompleted(AProc: TAnimationNotify) : TAnimationConfig
   ///  [line: 170, column: 27, file: SmartCL.Animation]
   ,SetOnCompleted:function(Self, AProc) {
      var Result = null;
      Self.FNotifyAtEnd = AProc;
      Result = Self;
      return Result
   }
   ,Destroy:TObject.Destroy
};
/// TAnimation = class (TObject)
///  [line: 47, column: 3, file: SmartCL.Animation]
var TAnimation = {
   $ClassName:"TAnimation",
   $Parent:TObject
   ,$Init:function ($) {
      TObject.$Init($);
      $.FAnimationStep = null;
      $.FCompleted = false;
      $.FConfig = $.FControl$1 = $.FNotifyAtEnd$1 = $.FRepeater$1 = null;
      $.FTimeStart = 0;
      $.FTime_ms = 0;
   }
   /// function TAnimation.AnimationTimer(Sender: TObject) : Boolean
   ///  [line: 195, column: 21, file: SmartCL.Animation]
   ,AnimationTimer:function(Self, Sender$8) {
      var Result = false;
      var progress = 0;
      Result = false;
      progress = ((Now()-Self.FTimeStart)*(24*60*60*1000))/Self.FTime_ms;
      if (progress>1) {
         progress = 1;
      }
      Self.FAnimationStep(progress);
      if (progress==1) {
         if ((Self.FConfig!==null)&&Self.FConfig.FLoop) {
            Self.FTimeStart = Now()-(20/(24*60*60*1000));
         } else {
            Self.FCompleted = true;
            Self.FNotifyAtEnd$1(Self);
            Result = true;
         }
      }
      return Result
   }
   /// constructor TAnimation.Create(control: TW3CustomControl; time_ms: Integer; config: TAnimationConfig; animationStep: TAnimationStep)
   ///  [line: 184, column: 24, file: SmartCL.Animation]
   ,Create$58:function(Self, control$1, time_ms$2, config$3, animationStep) {
      TObject.Create(Self);
      Self.FAnimationStep = animationStep;
      Self.FControl$1 = control$1;
      Self.FTime_ms = time_ms$2;
      Self.FConfig = config$3;
      Self.FCompleted = false;
      return Self
   }
   /// destructor TAnimation.Destroy()
   ///  [line: 211, column: 23, file: SmartCL.Animation]
   ,Destroy:function(Self) {
      if (Self.FRepeater$1) {
         TObject.Free(Self.FRepeater$1);
      }
      Self.FRepeater$1 = null;
      TObject.Destroy(Self);
   }
   /// procedure TAnimation.Initialize(var animationStep: TAnimationStep)
   ///  [line: 218, column: 22, file: SmartCL.Animation]
   ,Initialize:function(Self, animationStep$1) {
   }
   /// function TAnimation.Interpolate(vStart: Integer; vStop: Integer; progress: Float) : Integer
   ///  [line: 223, column: 27, file: SmartCL.Animation]
   ,Interpolate$1:function(Self, vStart, vStop, progress$1) {
      var Result = 0;
      Result = Math.round(vStart+((vStop-vStart)*progress$1));
      return Result
   }
   /// function TAnimation.IsActive() : Boolean
   ///  [line: 233, column: 21, file: SmartCL.Animation]
   ,IsActive$1:function(Self) {
      var Result = false;
      Result = Self.FRepeater$1!==null;
      return Result
   }
   /// procedure TAnimation.Start(notifyAtEnd: TAnimationNotifyAni)
   ///  [line: 238, column: 22, file: SmartCL.Animation]
   ,Start$2:function(Self, notifyAtEnd) {
      var animationStep$2 = {v:null};
      animationStep$2.v = Self.FAnimationStep;
      TAnimation.Initialize$(Self,animationStep$2);
      Self.FAnimationStep = animationStep$2.v;
      Self.FTimeStart = Now();
      Self.FNotifyAtEnd$1 = notifyAtEnd;
      Self.FRepeater$1 = TW3EventRepeater.Create$55($New(TW3EventRepeater),$Event1(Self,TAnimation.AnimationTimer),20);
   }
   ,Destroy$:function($){return $.ClassType.Destroy($)}
   ,Initialize$:function($){return $.ClassType.Initialize.apply($.ClassType, arguments)}
};
/// AnimationStart enumeration
///  [line: 25, column: 3, file: SmartCL.Animation]
var AnimationStart = [ "Immediate", "AfterPrevious" ];
function Animation() {
   var Result = null;
   if (!GAnimationManager) {
      GAnimationManager = TObject.Create($New(TAnimationManager));
   }
   Result = GAnimationManager;
   return Result
};
/// TMoveAnimation = class (TAnimation)
///  [line: 118, column: 3, file: SmartCL.Animation]
var TMoveAnimation = {
   $ClassName:"TMoveAnimation",
   $Parent:TAnimation
   ,$Init:function ($) {
      TAnimation.$Init($);
      $.FCachedIndex = 0;
      $.FRelativeMove = false;
      $.FToPoint = {X$1:0,Y$1:0};
   }
   /// constructor TMoveAnimation.Create(control: TW3CustomControl; time_ms: Integer; config: TAnimationConfig; path: TAnimationPath)
   ///  [line: 280, column: 28, file: SmartCL.Animation]
   ,Create$63:function(Self, control$2, time_ms$3, config$4, path) {
      var i$3 = 0;
      var lengths = [];
      var totalLen = 0;
      Self.FRelativeMove = false;
      /* null */
/* null */
totalLen = 0;
      lengths.push(totalLen);
      var $temp27;
      for(i$3 = 0,$temp27 = path.length-4;i$3<=$temp27;i$3+=2) {
         totalLen = totalLen+Math.sqrt(Math.pow(path[i$3+2]-path[i$3],2)+Math.pow(path[i$3+3]-path[i$3+1],2));
         lengths.push(totalLen);
      }
      TAnimation.Create$58(Self,control$2,time_ms$3,config$4,function (progress$2) {
         var x$18 = {};
         x$18.v = 0;
         var y$7 = {};
         y$7.v = 0;
         TMoveAnimation.FindPathCoords(Self,progress$2,path,lengths,totalLen,x$18,y$7);
         TW3TagObj.BeginUpdate(control$2);
         TW3MovableControl.SetLeft(control$2,x$18.v);
         TW3MovableControl.SetTop(control$2,y$7.v);
         TW3TagObj.EndUpdate(control$2);
      });
      return Self
   }
   /// constructor TMoveAnimation.Create(control: TW3CustomControl; time_ms: Integer; config: TAnimationConfig; fromPoint: TPoint; toPoint: TPoint)
   ///  [line: 258, column: 28, file: SmartCL.Animation]
   ,Create$62:function(Self, control$3, time_ms$4, config$5, fromPoint, toPoint) {
      TAnimation.Create$58(Self,control$3,time_ms$4,config$5,function (progress$3) {
         TW3TagObj.BeginUpdate(control$3);
         TW3MovableControl.SetLeft(control$3,TAnimation.Interpolate$1(Self.ClassType,fromPoint.X$1,toPoint.X$1,progress$3));
         TW3MovableControl.SetTop(control$3,TAnimation.Interpolate$1(Self.ClassType,fromPoint.Y$1,toPoint.Y$1,progress$3));
         TW3TagObj.EndUpdate(control$3);
      });
      Self.FRelativeMove = false;
      return Self
   }
   /// constructor TMoveAnimation.Create(control: TW3CustomControl; time_ms: Integer; config: TAnimationConfig; toPoint: TPoint)
   ///  [line: 272, column: 28, file: SmartCL.Animation]
   ,Create$61:function(Self, control$4, time_ms$5, config$6, toPoint$1) {
      TAnimation.Create$58(Self,control$4,time_ms$5,config$6,null);
      Self.FRelativeMove = true;
      Copy$TPoint(toPoint$1,Self.FToPoint);
      return Self
   }
   /// procedure TMoveAnimation.FindPathCoords(progress: Float; path: TAnimationPath; lengths: array of Float; totalLen: Float; var x: Integer; var y: Integer)
   ///  [line: 308, column: 26, file: SmartCL.Animation]
   ,FindPathCoords:function(Self, progress$4, path$1, lengths$1, totalLen$1, x$19, y$8) {
      var linePart = 0;
      progress$4 = progress$4*totalLen$1;
      if (progress$4>=lengths$1[Self.FCachedIndex+1]) {
         while ((Self.FCachedIndex<(lengths$1.length-2))&&(progress$4>=lengths$1[Self.FCachedIndex+1])) {
            ++Self.FCachedIndex         }
      }
      linePart = (progress$4-lengths$1[Self.FCachedIndex])/(lengths$1[Self.FCachedIndex+1]-lengths$1[Self.FCachedIndex]);
      if (linePart>1) {
         linePart = 1;
      }
      x$19.v = TAnimation.Interpolate$1(Self.ClassType,path$1[Self.FCachedIndex*2],path$1[(Self.FCachedIndex*2)+2],linePart);
      y$8.v = TAnimation.Interpolate$1(Self.ClassType,path$1[(Self.FCachedIndex*2)+1],path$1[(Self.FCachedIndex*2)+3],linePart);
   }
   /// procedure TMoveAnimation.Initialize(var animationStep: TAnimationStep)
   ///  [line: 322, column: 26, file: SmartCL.Animation]
   ,Initialize:function(Self, animationStep$3) {
      var fromPoint$1 = {X$1:0,Y$1:0};
      if (Self.FRelativeMove) {
         fromPoint$1 = Create$13(TW3MovableControl.GetLeft(Self.FControl$1),TW3MovableControl.GetTop(Self.FControl$1));
         animationStep$3.v = function (progress$5) {
            TW3TagObj.BeginUpdate(Self.FControl$1);
            TW3MovableControl.SetLeft(Self.FControl$1,TAnimation.Interpolate$1(Self.ClassType,fromPoint$1.X$1,Self.FToPoint.X$1,progress$5));
            TW3MovableControl.SetTop(Self.FControl$1,TAnimation.Interpolate$1(Self.ClassType,fromPoint$1.Y$1,Self.FToPoint.Y$1,progress$5));
            TW3TagObj.EndUpdate(Self.FControl$1);
         };
      }
   }
   ,Destroy:TAnimation.Destroy
   ,Initialize$:function($){return $.ClassType.Initialize.apply($.ClassType, arguments)}
};
/// TW3Image = class (TW3CustomControl)
///  [line: 17, column: 3, file: SmartCL.Controls.Image]
var TW3Image = {
   $ClassName:"TW3Image",
   $Parent:TW3CustomControl
   ,$Init:function ($) {
      TW3CustomControl.$Init($);
      $.FOnLoad = null;
   }
   /// procedure TW3Image.CBOnLoad()
   ///  [line: 113, column: 20, file: SmartCL.Controls.Image]
   ,CBOnLoad:function(Self) {
      if (Self.FOnLoad) {
         Self.FOnLoad(Self);
      }
   }
   /// function TW3Image.getEnabled() : Boolean
   ///  [line: 69, column: 19, file: SmartCL.Controls.Image]
   ,GetEnabled:function(Self) {
      var Result = false;
      Result = true;
      return Result
   }
   /// function TW3Image.getHeight() : Integer
   ///  [line: 91, column: 19, file: SmartCL.Controls.Image]
   ,GetHeight:function(Self) {
      var Result = 0;
      Result = TW3MovableControl.GetHeight(Self);
      if (Result==0) {
         if (Self.FHandle) {
            Result = parseInt(Self.FHandle.height,10);
         }
      }
      return Result
   }
   /// function TW3Image.getReady() : Boolean
   ///  [line: 55, column: 19, file: SmartCL.Controls.Image]
   ,getReady:function(Self) {
      var Result = false;
      if (Self.FHandle) {
         Result = (Self.FHandle.complete&&(Self.FHandle.naturalWidth>0))&&(Self.FHandle.naturalHeight>0);
      }
      return Result
   }
   /// function TW3Image.getSrc() : String
   ///  [line: 63, column: 19, file: SmartCL.Controls.Image]
   ,getSrc:function(Self) {
      var Result = "";
      if (Self.FHandle) {
         Result = ""+Self.FHandle.src;
      }
      return Result
   }
   /// function TW3Image.getWidth() : Integer
   ///  [line: 76, column: 19, file: SmartCL.Controls.Image]
   ,GetWidth:function(Self) {
      var Result = 0;
      Result = TW3MovableControl.GetWidth(Self);
      if (Result==0) {
         if (Self.FHandle) {
            Result = parseInt(Self.FHandle.width,10);
         }
      }
      return Result
   }
   /// procedure TW3Image.LoadFromURL(aURL: String)
   ///  [line: 119, column: 20, file: SmartCL.Controls.Image]
   ,LoadFromURL:function(Self, aURL) {
      w3_setAttrib(Self.FHandle,"src",aURL);
   }
   /// function TW3Image.makeElementTagObj() : THandle
   ///  [line: 50, column: 19, file: SmartCL.Controls.Image]
   ,MakeElementTagObj:function(Self) {
      var Result = undefined;
      Result = w3_createHtmlElement("img");
      return Result
   }
   /// procedure TW3Image.setSrc(Value: String)
   ///  [line: 124, column: 20, file: SmartCL.Controls.Image]
   ,setSrc:function(Self, Value$13) {
      if (Value$13!=TW3Image.getSrc(Self)) {
         TW3Image.LoadFromURL(Self,Value$13);
      }
   }
   /// procedure TW3Image._setOnLoad(aValue: TNotifyEvent)
   ///  [line: 104, column: 20, file: SmartCL.Controls.Image]
   ,_setOnLoad:function(Self, aValue$63) {
      Self.FOnLoad = aValue$63;
      w3_bind2(Self.FHandle,"onload",(aValue$63)?$Event0(Self,TW3Image.CBOnLoad):$Event0(Self,TW3Component.CBNoBehavior));
   }
   ,Destroy:TW3TagObj.Destroy
   ,AfterUpdate:TW3CustomControl.AfterUpdate
   ,FinalizeObject:TW3CustomControl.FinalizeObject
   ,InitializeObject:TW3CustomControl.InitializeObject
   ,MakeElementTagId:TW3TagObj.MakeElementTagId
   ,MakeElementTagObj$:function($){return $.ClassType.MakeElementTagObj($)}
   ,StyleTagObject:TW3CustomControl.StyleTagObject
   ,ChildAdded:TW3Component.ChildAdded
   ,Create$18:TW3CustomControl.Create$18
   ,GetHeight$:function($){return $.ClassType.GetHeight($)}
   ,GetWidth$:function($){return $.ClassType.GetWidth($)}
   ,Resize:TW3MovableControl.Resize
   ,SetHeight:TW3MovableControl.SetHeight
   ,SetWidth:TW3MovableControl.SetWidth
   ,supportAdjustment:TW3MovableControl.supportAdjustment
   ,CBClick:TW3CustomControl.CBClick
   ,CBKeyDown:TW3CustomControl.CBKeyDown
   ,CBKeyUp:TW3CustomControl.CBKeyUp
   ,CBMouseDown:TW3CustomControl.CBMouseDown
   ,CBMouseMove:TW3CustomControl.CBMouseMove
   ,CBMouseUp:TW3CustomControl.CBMouseUp
   ,GetEnabled$:function($){return $.ClassType.GetEnabled($)}
   ,Invalidate:TW3CustomControl.Invalidate
   ,SetEnabled:TW3CustomControl.SetEnabled
};
/// TW3ListMenu = class (TW3CustomControl)
///  [line: 48, column: 3, file: SmartCL.Controls.ListMenu]
var TW3ListMenu = {
   $ClassName:"TW3ListMenu",
   $Parent:TW3CustomControl
   ,$Init:function ($) {
      TW3CustomControl.$Init($);
      $.FItems = null;
   }
   /// function TW3ListMenu.makeElementTagObj() : THandle
   ///  [line: 80, column: 22, file: SmartCL.Controls.ListMenu]
   ,MakeElementTagObj:function(Self) {
      var Result = undefined;
      Result = w3_createHtmlElement("ul");
      return Result
   }
   /// procedure TW3ListMenu.InitializeObject()
   ///  [line: 68, column: 23, file: SmartCL.Controls.ListMenu]
   ,InitializeObject:function(Self) {
      TW3CustomControl.InitializeObject(Self);
      Self.FItems = TW3OwnedObject.Create$4$($New(TW3ListItems),Self);
   }
   /// procedure TW3ListMenu.FinalizeObject()
   ///  [line: 74, column: 23, file: SmartCL.Controls.ListMenu]
   ,FinalizeObject:function(Self) {
      TObject.Free(Self.FItems);
      TW3CustomControl.FinalizeObject(Self);
   }
   /// procedure TW3ListMenu.StyleTagObject()
   ///  [line: 85, column: 23, file: SmartCL.Controls.ListMenu]
   ,StyleTagObject:function(Self) {
      TW3CustomControl.StyleTagObject(Self);
      TW3CustomControl.SetStyleClass(Self,"ul");
   }
   ,Destroy:TW3TagObj.Destroy
   ,AfterUpdate:TW3CustomControl.AfterUpdate
   ,FinalizeObject$:function($){return $.ClassType.FinalizeObject($)}
   ,InitializeObject$:function($){return $.ClassType.InitializeObject($)}
   ,MakeElementTagId:TW3TagObj.MakeElementTagId
   ,MakeElementTagObj$:function($){return $.ClassType.MakeElementTagObj($)}
   ,StyleTagObject$:function($){return $.ClassType.StyleTagObject($)}
   ,ChildAdded:TW3Component.ChildAdded
   ,Create$18:TW3CustomControl.Create$18
   ,GetHeight:TW3MovableControl.GetHeight
   ,GetWidth:TW3MovableControl.GetWidth
   ,Resize:TW3MovableControl.Resize
   ,SetHeight:TW3MovableControl.SetHeight
   ,SetWidth:TW3MovableControl.SetWidth
   ,supportAdjustment:TW3MovableControl.supportAdjustment
   ,CBClick:TW3CustomControl.CBClick
   ,CBKeyDown:TW3CustomControl.CBKeyDown
   ,CBKeyUp:TW3CustomControl.CBKeyUp
   ,CBMouseDown:TW3CustomControl.CBMouseDown
   ,CBMouseMove:TW3CustomControl.CBMouseMove
   ,CBMouseUp:TW3CustomControl.CBMouseUp
   ,GetEnabled:TW3CustomControl.GetEnabled
   ,Invalidate:TW3CustomControl.Invalidate
   ,SetEnabled:TW3CustomControl.SetEnabled
};
/// TW3ListItems = class (TW3OwnedObject)
///  [line: 29, column: 3, file: SmartCL.Controls.ListMenu]
var TW3ListItems = {
   $ClassName:"TW3ListItems",
   $Parent:TW3OwnedObject
   ,$Init:function ($) {
      TW3OwnedObject.$Init($);
      $.FObjects$1 = null;
   }
   /// function TW3ListItems.AcceptParent(aObject: TObject) : Boolean
   ///  [line: 147, column: 23, file: SmartCL.Controls.ListMenu]
   ,AcceptParent:function(Self, aObject$5) {
      var Result = false;
      Result = (aObject$5!==null)&&$Is(aObject$5,TW3ListMenu);
      return Result
   }
   /// procedure TW3ListItems.Clear()
   ///  [line: 152, column: 24, file: SmartCL.Controls.ListMenu]
   ,Clear$6:function(Self) {
      var x$20 = 0;
      var $temp28;
      for(x$20 = 0,$temp28 = TObjectList.GetCount$1(Self.FObjects$1);x$20<$temp28;x$20++) {
         TObject.Free(TObjectList.GetItem$5(Self.FObjects$1,x$20));
      }
      TObjectList.Clear$2(Self.FObjects$1);
   }
   /// constructor TW3ListItems.Create(AOwner: TObject)
   ///  [line: 134, column: 26, file: SmartCL.Controls.ListMenu]
   ,Create$4:function(Self, AOwner$9) {
      TW3OwnedObject.Create$4(Self,AOwner$9);
      Self.FObjects$1 = TObjectList.Create$38($New(TObjectList));
      return Self
   }
   /// destructor TW3ListItems.Destroy()
   ///  [line: 140, column: 25, file: SmartCL.Controls.ListMenu]
   ,Destroy:function(Self) {
      TW3ListItems.Clear$6(Self);
      TObject.Free(Self.FObjects$1);
      TObject.Destroy(Self);
   }
   ,Destroy$:function($){return $.ClassType.Destroy($)}
   ,AcceptParent$:function($){return $.ClassType.AcceptParent.apply($.ClassType, arguments)}
   ,Create$4$:function($){return $.ClassType.Create$4.apply($.ClassType, arguments)}
};
/// TW3ListItem = class (TW3CustomControl)
///  [line: 17, column: 3, file: SmartCL.Controls.ListMenu]
var TW3ListItem = {
   $ClassName:"TW3ListItem",
   $Parent:TW3CustomControl
   ,$Init:function ($) {
      TW3CustomControl.$Init($);
   }
   /// function TW3ListItem.makeElementTagObj() : THandle
   ///  [line: 113, column: 22, file: SmartCL.Controls.ListMenu]
   ,MakeElementTagObj:function(Self) {
      var Result = undefined;
      Result = w3_createHtmlElement("li");
      return Result
   }
   /// procedure TW3ListItem.StyleTagObject()
   ///  [line: 118, column: 23, file: SmartCL.Controls.ListMenu]
   ,StyleTagObject:function(Self) {
      TW3CustomControl.SetStyleClass(Self,"li");
   }
   /// function TW3ListItem.getEnabled() : Boolean
   ///  [line: 123, column: 22, file: SmartCL.Controls.ListMenu]
   ,GetEnabled:function(Self) {
      var Result = false;
      Result = true;
      return Result
   }
   ,Destroy:TW3TagObj.Destroy
   ,AfterUpdate:TW3CustomControl.AfterUpdate
   ,FinalizeObject:TW3CustomControl.FinalizeObject
   ,InitializeObject:TW3CustomControl.InitializeObject
   ,MakeElementTagId:TW3TagObj.MakeElementTagId
   ,MakeElementTagObj$:function($){return $.ClassType.MakeElementTagObj($)}
   ,StyleTagObject$:function($){return $.ClassType.StyleTagObject($)}
   ,ChildAdded:TW3Component.ChildAdded
   ,Create$18:TW3CustomControl.Create$18
   ,GetHeight:TW3MovableControl.GetHeight
   ,GetWidth:TW3MovableControl.GetWidth
   ,Resize:TW3MovableControl.Resize
   ,SetHeight:TW3MovableControl.SetHeight
   ,SetWidth:TW3MovableControl.SetWidth
   ,supportAdjustment:TW3MovableControl.supportAdjustment
   ,CBClick:TW3CustomControl.CBClick
   ,CBKeyDown:TW3CustomControl.CBKeyDown
   ,CBKeyUp:TW3CustomControl.CBKeyUp
   ,CBMouseDown:TW3CustomControl.CBMouseDown
   ,CBMouseMove:TW3CustomControl.CBMouseMove
   ,CBMouseUp:TW3CustomControl.CBMouseUp
   ,GetEnabled$:function($){return $.ClassType.GetEnabled($)}
   ,Invalidate:TW3CustomControl.Invalidate
   ,SetEnabled:TW3CustomControl.SetEnabled
};
/// TW3ToolButton = class (TW3CustomControl)
///  [line: 17, column: 3, file: SmartCL.Controls.ToolButton]
var TW3ToolButton = {
   $ClassName:"TW3ToolButton",
   $Parent:TW3CustomControl
   ,$Init:function ($) {
      TW3CustomControl.$Init($);
   }
   /// function TW3ToolButton.getCaption() : String
   ///  [line: 53, column: 24, file: SmartCL.Controls.ToolButton]
   ,getCaption:function(Self) {
      var Result = "";
      Result = w3_getPropertyAsStr(Self.FHandle,"innerHTML");
      return Result
   }
   /// procedure TW3ToolButton.setCaption(aNewCaption: String)
   ///  [line: 58, column: 25, file: SmartCL.Controls.ToolButton]
   ,setCaption$1:function(Self, aNewCaption) {
      w3_setProperty(Self.FHandle,"innerHTML",aNewCaption);
   }
   /// function TW3ToolButton.makeElementTagObj() : THandle
   ///  [line: 42, column: 24, file: SmartCL.Controls.ToolButton]
   ,MakeElementTagObj:function(Self) {
      var Result = undefined;
      Result = w3_createHtmlElement("button");
      return Result
   }
   /// procedure TW3ToolButton.StyleTagObject()
   ///  [line: 47, column: 25, file: SmartCL.Controls.ToolButton]
   ,StyleTagObject:function(Self) {
      TW3CustomControl.StyleTagObject(Self);
      w3_setStyle(Self.FHandle,"fontSmooth","always");
   }
   /// procedure TW3ToolButton.InitializeObject()
   ///  [line: 35, column: 25, file: SmartCL.Controls.ToolButton]
   ,InitializeObject:function(Self) {
      TW3CustomControl.InitializeObject(Self);
      TW3MovableControl.SetWidth$(Self,70);
      TW3MovableControl.SetHeight$(Self,30);
   }
   ,Destroy:TW3TagObj.Destroy
   ,AfterUpdate:TW3CustomControl.AfterUpdate
   ,FinalizeObject:TW3CustomControl.FinalizeObject
   ,InitializeObject$:function($){return $.ClassType.InitializeObject($)}
   ,MakeElementTagId:TW3TagObj.MakeElementTagId
   ,MakeElementTagObj$:function($){return $.ClassType.MakeElementTagObj($)}
   ,StyleTagObject$:function($){return $.ClassType.StyleTagObject($)}
   ,ChildAdded:TW3Component.ChildAdded
   ,Create$18:TW3CustomControl.Create$18
   ,GetHeight:TW3MovableControl.GetHeight
   ,GetWidth:TW3MovableControl.GetWidth
   ,Resize:TW3MovableControl.Resize
   ,SetHeight:TW3MovableControl.SetHeight
   ,SetWidth:TW3MovableControl.SetWidth
   ,supportAdjustment:TW3MovableControl.supportAdjustment
   ,CBClick:TW3CustomControl.CBClick
   ,CBKeyDown:TW3CustomControl.CBKeyDown
   ,CBKeyUp:TW3CustomControl.CBKeyUp
   ,CBMouseDown:TW3CustomControl.CBMouseDown
   ,CBMouseMove:TW3CustomControl.CBMouseMove
   ,CBMouseUp:TW3CustomControl.CBMouseUp
   ,GetEnabled:TW3CustomControl.GetEnabled
   ,Invalidate:TW3CustomControl.Invalidate
   ,SetEnabled:TW3CustomControl.SetEnabled
};
/// TW3ToolbarButton = class (TW3CustomControl)
///  [line: 19, column: 3, file: SmartCL.Controls.ToolBar]
var TW3ToolbarButton = {
   $ClassName:"TW3ToolbarButton",
   $Parent:TW3CustomControl
   ,$Init:function ($) {
      TW3CustomControl.$Init($);
      $.a$37 = 0;
      $.a$36 = false;
      $.FCaption$2 = "";
      $.FGlyph = $.FOnDestroy = null;
   }
   /// procedure TW3ToolbarButton.CBClick(eventObj: JEvent)
   ///  [line: 145, column: 28, file: SmartCL.Controls.ToolBar]
   ,CBClick:function(Self, eventObj$24) {
      if (Self.a$37>0) {
         if (!TW3ToolbarButton.getDown(Self)) {
            TW3ToolbarButton.MakeGroupUp(Self,Self.a$37);
            TW3ToolbarButton.setDown(Self,true);
         } else if (Self.a$36) {
            TW3ToolbarButton.setDown(Self,false);
         }
      }
      TW3CustomControl.CBClick(Self,eventObj$24);
   }
   /// procedure TW3ToolbarButton.ChangeCaption(aNewCaption: String)
   ///  [line: 98, column: 28, file: SmartCL.Controls.ToolBar]
   ,ChangeCaption:function(Self, aNewCaption$1) {
      var mHtml = "";
      Self.FCaption$2 = aNewCaption$1;
      if (TW3Image.getReady(Self.FGlyph)) {
         mHtml = mHtml+"<img src=\""+TW3Image.getSrc(Self.FGlyph)+"\" width=16px height=16px>";
         mHtml = mHtml+"<br>";
      }
      mHtml = mHtml+Self.FCaption$2;
      TW3TagObj.SetInnerHTML(Self,mHtml);
   }
   /// constructor TW3ToolbarButton.Create(AOwner: TW3CustomControl; OnDestroy: TNotifyEvent = nil)
   ///  [line: 78, column: 30, file: SmartCL.Controls.ToolBar]
   ,Create$49:function(Self, AOwner$10, OnDestroy) {
      TW3CustomControl.Create$18(Self,AOwner$10);
      Self.FOnDestroy = OnDestroy;
      return Self
   }
   /// destructor TW3ToolbarButton.Destroy()
   ///  [line: 84, column: 29, file: SmartCL.Controls.ToolBar]
   ,Destroy:function(Self) {
      if (Self.FOnDestroy) {
         Self.FOnDestroy(Self);
      }
      TW3TagObj.Destroy(Self);
   }
   /// procedure TW3ToolbarButton.FinalizeObject()
   ///  [line: 114, column: 28, file: SmartCL.Controls.ToolBar]
   ,FinalizeObject:function(Self) {
      TObject.Free(Self.FGlyph);
      TW3CustomControl.FinalizeObject(Self);
   }
   /// function TW3ToolbarButton.getDown() : Boolean
   ///  [line: 158, column: 27, file: SmartCL.Controls.ToolBar]
   ,getDown:function(Self) {
      var Result = false;
      Result = TW3CSSClassStyleNames.IndexOf$2(TW3CustomControl.GetClassNames(Self),"ButtonDown")>=0;
      return Result
   }
   /// procedure TW3ToolbarButton.HandleGlyphReady(Sender: TObject)
   ///  [line: 120, column: 28, file: SmartCL.Controls.ToolBar]
   ,HandleGlyphReady:function(Self, Sender$9) {
      var mTemp$3 = "";
      mTemp$3 = Self.FCaption$2;
      Self.FCaption$2 = "";
      TW3ToolbarButton.ChangeCaption(Self,mTemp$3);
   }
   /// procedure TW3ToolbarButton.InitializeObject()
   ///  [line: 91, column: 28, file: SmartCL.Controls.ToolBar]
   ,InitializeObject:function(Self) {
      TW3CustomControl.InitializeObject(Self);
      Self.FGlyph = TW3Component.Create$18$($New(TW3Image),null);
      TW3Image._setOnLoad(Self.FGlyph,$Event1(Self,TW3ToolbarButton.HandleGlyphReady));
   }
   /// function TW3ToolbarButton.makeElementTagObj() : THandle
   ///  [line: 140, column: 27, file: SmartCL.Controls.ToolBar]
   ,MakeElementTagObj:function(Self) {
      var Result = undefined;
      Result = w3_createHtmlElement("button");
      return Result
   }
   /// procedure TW3ToolbarButton.MakeGroupUp(aGroupIndex: Integer)
   ///  [line: 173, column: 28, file: SmartCL.Controls.ToolBar]
   ,MakeGroupUp:function(Self, aGroupIndex) {
      var i$4 = 0;
      var btn = null;
      var $temp29;
      for(i$4 = 0,$temp29 = TW3Toolbar.getButtonCount(TW3ToolbarButton.Toolbar(Self));i$4<$temp29;i$4++) {
         btn = TW3Toolbar.getButton(TW3ToolbarButton.Toolbar(Self),i$4);
         if ((btn.a$37==aGroupIndex)&&TW3ToolbarButton.getDown(btn)) {
            TW3ToolbarButton.setDown(btn,false);
         }
      }
   }
   /// procedure TW3ToolbarButton.SetCaption(aNewCaption: String)
   ///  [line: 134, column: 28, file: SmartCL.Controls.ToolBar]
   ,SetCaption$2:function(Self, aNewCaption$2) {
      if (aNewCaption$2!=Self.FCaption$2) {
         TW3ToolbarButton.ChangeCaption(Self,aNewCaption$2);
      }
   }
   /// procedure TW3ToolbarButton.setDown(Value: Boolean)
   ///  [line: 163, column: 28, file: SmartCL.Controls.ToolBar]
   ,setDown:function(Self, Value$14) {
      if (Value$14) {
         if (!TW3ToolbarButton.getDown(Self)) {
            TW3CSSClassStyleNames.Add$2(TW3CustomControl.GetClassNames(Self),"ButtonDown");
         }
      } else if (TW3ToolbarButton.getDown(Self)) {
         TW3CSSClassStyleNames.RemoveByName(TW3CustomControl.GetClassNames(Self),"ButtonDown");
      }
   }
   /// function TW3ToolbarButton.Toolbar() : TW3Toolbar
   ///  [line: 129, column: 27, file: SmartCL.Controls.ToolBar]
   ,Toolbar:function(Self) {
      var Result = null;
      Result = $As(Self.FParent,TW3Toolbar);
      return Result
   }
   ,Destroy$:function($){return $.ClassType.Destroy($)}
   ,AfterUpdate:TW3CustomControl.AfterUpdate
   ,FinalizeObject$:function($){return $.ClassType.FinalizeObject($)}
   ,InitializeObject$:function($){return $.ClassType.InitializeObject($)}
   ,MakeElementTagId:TW3TagObj.MakeElementTagId
   ,MakeElementTagObj$:function($){return $.ClassType.MakeElementTagObj($)}
   ,StyleTagObject:TW3CustomControl.StyleTagObject
   ,ChildAdded:TW3Component.ChildAdded
   ,Create$18:TW3CustomControl.Create$18
   ,GetHeight:TW3MovableControl.GetHeight
   ,GetWidth:TW3MovableControl.GetWidth
   ,Resize:TW3MovableControl.Resize
   ,SetHeight:TW3MovableControl.SetHeight
   ,SetWidth:TW3MovableControl.SetWidth
   ,supportAdjustment:TW3MovableControl.supportAdjustment
   ,CBClick$:function($){return $.ClassType.CBClick.apply($.ClassType, arguments)}
   ,CBKeyDown:TW3CustomControl.CBKeyDown
   ,CBKeyUp:TW3CustomControl.CBKeyUp
   ,CBMouseDown:TW3CustomControl.CBMouseDown
   ,CBMouseMove:TW3CustomControl.CBMouseMove
   ,CBMouseUp:TW3CustomControl.CBMouseUp
   ,GetEnabled:TW3CustomControl.GetEnabled
   ,Invalidate:TW3CustomControl.Invalidate
   ,SetEnabled:TW3CustomControl.SetEnabled
};
/// TW3Toolbar = class (TW3CustomControl)
///  [line: 47, column: 3, file: SmartCL.Controls.ToolBar]
var TW3Toolbar = {
   $ClassName:"TW3Toolbar",
   $Parent:TW3CustomControl
   ,$Init:function ($) {
      TW3CustomControl.$Init($);
      $.FBtnHeight = $.FBtnSpacing = $.FBtnWidth = 0;
      $.FButtons = [];
   }
   /// function TW3Toolbar.getButton(idx: Integer) : TW3ToolbarButton
   ///  [line: 268, column: 21, file: SmartCL.Controls.ToolBar]
   ,getButton:function(Self, idx$3) {
      var Result = null;
      Result = Self.FButtons[idx$3];
      return Result
   }
   /// function TW3Toolbar.getButtonCount() : Integer
   ///  [line: 273, column: 21, file: SmartCL.Controls.ToolBar]
   ,getButtonCount:function(Self) {
      var Result = 0;
      Result = Self.FButtons.length;
      return Result
   }
   /// procedure TW3Toolbar.InitializeObject()
   ///  [line: 186, column: 22, file: SmartCL.Controls.ToolBar]
   ,InitializeObject:function(Self) {
      TW3CustomControl.InitializeObject(Self);
      Self.FBtnWidth = 100;
      Self.FBtnHeight = 36;
      Self.FBtnSpacing = 2;
   }
   /// procedure TW3Toolbar.Resize()
   ///  [line: 231, column: 22, file: SmartCL.Controls.ToolBar]
   ,Resize:function(Self) {
      var x$21 = 0;
      var dx$5 = 0;
      var dy$6 = 0;
      var mChild$2 = null;
      dx$5 = Self.FBtnSpacing;
      var $temp30;
      for(x$21 = 0,$temp30 = TW3Component.GetChildCount(Self);x$21<$temp30;x$21++) {
         mChild$2 = TW3Component.GetChildObject(Self,x$21);
         if ($Is(mChild$2,TW3ToolbarButton)) {
            dy$6 = 0;
            TW3MovableControl.SetBounds$2($As(mChild$2,TW3ToolbarButton),dx$5,dy$6,Self.FBtnWidth,TW3MovableControl.GetHeight$(Self));
            (dx$5+= (Self.FBtnWidth+Self.FBtnSpacing));
         }
      }
   }
   /// procedure TW3Toolbar.setBtnHeight(Value: Integer)
   ///  [line: 206, column: 22, file: SmartCL.Controls.ToolBar]
   ,setBtnHeight:function(Self, Value$15) {
      if (Self.FObjReady) {
         Value$15 = ClampInt(Value$15,16,TW3MovableControl.GetHeight$(Self));
      } else {
         Value$15 = Math.max(Value$15,16);
      }
      if (Value$15!=Self.FBtnHeight) {
         TW3TagObj.BeginUpdate(Self);
         Self.FBtnHeight = Value$15;
         TW3MovableControl.SetWasSized(Self);
         TW3TagObj.EndUpdate(Self);
      }
   }
   /// procedure TW3Toolbar.setBtnSpacing(Value: Integer)
   ///  [line: 221, column: 22, file: SmartCL.Controls.ToolBar]
   ,setBtnSpacing:function(Self, Value$16) {
      Value$16 = Math.max(Value$16,1);
      if (Value$16!=Self.FBtnSpacing) {
         Self.FBtnSpacing = Value$16;
         TW3CustomControl.LayoutChildren(Self);
      }
   }
   /// procedure TW3Toolbar.setBtnWidth(Value: Integer)
   ///  [line: 194, column: 22, file: SmartCL.Controls.ToolBar]
   ,setBtnWidth:function(Self, Value$17) {
      Value$17 = Math.max(Value$17,16);
      if (Value$17!=Self.FBtnWidth) {
         TW3TagObj.BeginUpdate(Self);
         Self.FBtnWidth = Value$17;
         TW3MovableControl.SetWasSized(Self);
         TW3TagObj.EndUpdate(Self);
      }
   }
   ,Destroy:TW3TagObj.Destroy
   ,AfterUpdate:TW3CustomControl.AfterUpdate
   ,FinalizeObject:TW3CustomControl.FinalizeObject
   ,InitializeObject$:function($){return $.ClassType.InitializeObject($)}
   ,MakeElementTagId:TW3TagObj.MakeElementTagId
   ,MakeElementTagObj:TW3TagObj.MakeElementTagObj
   ,StyleTagObject:TW3CustomControl.StyleTagObject
   ,ChildAdded:TW3Component.ChildAdded
   ,Create$18:TW3CustomControl.Create$18
   ,GetHeight:TW3MovableControl.GetHeight
   ,GetWidth:TW3MovableControl.GetWidth
   ,Resize$:function($){return $.ClassType.Resize($)}
   ,SetHeight:TW3MovableControl.SetHeight
   ,SetWidth:TW3MovableControl.SetWidth
   ,supportAdjustment:TW3MovableControl.supportAdjustment
   ,CBClick:TW3CustomControl.CBClick
   ,CBKeyDown:TW3CustomControl.CBKeyDown
   ,CBKeyUp:TW3CustomControl.CBKeyUp
   ,CBMouseDown:TW3CustomControl.CBMouseDown
   ,CBMouseMove:TW3CustomControl.CBMouseMove
   ,CBMouseUp:TW3CustomControl.CBMouseUp
   ,GetEnabled:TW3CustomControl.GetEnabled
   ,Invalidate:TW3CustomControl.Invalidate
   ,SetEnabled:TW3CustomControl.SetEnabled
};
/// TW3CustomScrollBar = class (TW3CustomControl)
///  [line: 24, column: 3, file: SmartCL.Controls.ScrollBar]
var TW3CustomScrollBar = {
   $ClassName:"TW3CustomScrollBar",
   $Parent:TW3CustomControl
   ,$Init:function ($) {
      TW3CustomControl.$Init($);
      $.FDownBtn = $.FHandle$4 = $.FUpBtn = null;
      $.FPageSize = $.FPosition = $.FTotal = 0;
   }
   /// function TW3CustomScrollBar.calcSizeOfHandle() : Integer
   ///  [line: 209, column: 29, file: SmartCL.Controls.ScrollBar]
   ,calcSizeOfHandle:function(Self) {
      var Result = 0;
      var mTemp$4 = 0;
      mTemp$4 = TInteger.PercentOfValue(Self.FPageSize,Self.FTotal);
      Result = Trunc((mTemp$4*TW3CustomScrollBar.getArea$(Self))/100);
      return Result
   }
   /// procedure TW3CustomScrollBar.FinalizeObject()
   ///  [line: 117, column: 30, file: SmartCL.Controls.ScrollBar]
   ,FinalizeObject:function(Self) {
      TObject.Free(Self.FUpBtn);
      TObject.Free(Self.FDownBtn);
      TObject.Free(Self.FHandle$4);
      TW3CustomControl.FinalizeObject(Self);
   }
   /// procedure TW3CustomScrollBar.HandleMaxClick(Sender: TObject)
   ///  [line: 131, column: 30, file: SmartCL.Controls.ScrollBar]
   ,HandleMaxClick:function(Self, Sender$10) {
      if (Self.FTotal>0) {
         TW3CustomScrollBar.setPosition(Self,Self.FPosition+Self.FPageSize);
      }
   }
   /// procedure TW3CustomScrollBar.HandleMinClick(Sender: TObject)
   ///  [line: 125, column: 30, file: SmartCL.Controls.ScrollBar]
   ,HandleMinClick:function(Self, Sender$11) {
      if (Self.FTotal>0) {
         TW3CustomScrollBar.setPosition(Self,Self.FPosition-Self.FPageSize);
      }
   }
   /// procedure TW3CustomScrollBar.InitializeObject()
   ///  [line: 105, column: 30, file: SmartCL.Controls.ScrollBar]
   ,InitializeObject:function(Self) {
      TW3CustomControl.InitializeObject(Self);
      Self.FUpBtn = TW3Component.Create$18$($New(TW3ScrollbarLowerBtn),Self);
      TW3CustomControl._setMouseClick(Self.FUpBtn,$Event1(Self,TW3CustomScrollBar.HandleMinClick));
      Self.FDownBtn = TW3Component.Create$18$($New(TW3ScrollbarHigherBtn),Self);
      TW3CustomControl._setMouseClick(Self.FDownBtn,$Event1(Self,TW3CustomScrollBar.HandleMaxClick));
      Self.FHandle$4 = TW3Component.Create$18$($New(TW3ScrollbarHandle),Self);
   }
   /// function TW3CustomScrollBar.PixelOffsetToPosition(aPxPos: Integer) : Integer
   ///  [line: 225, column: 29, file: SmartCL.Controls.ScrollBar]
   ,PixelOffsetToPosition:function(Self, aPxPos) {
      var Result = 0;
      var mTemp$5 = 0;
      mTemp$5 = TInteger.PercentOfValue(aPxPos,TW3CustomScrollBar.getArea$(Self));
      Result = Trunc((mTemp$5*Self.FTotal)/100);
      return Result
   }
   /// function TW3CustomScrollBar.PositionToPixelOffset(aPosition: Integer) : Integer
   ///  [line: 217, column: 29, file: SmartCL.Controls.ScrollBar]
   ,PositionToPixelOffset:function(Self, aPosition) {
      var Result = 0;
      var mTemp$6 = 0;
      mTemp$6 = TInteger.PercentOfValue(aPosition,Self.FTotal);
      Result = Trunc((mTemp$6*TW3CustomScrollBar.getArea$(Self))/100);
      return Result
   }
   /// procedure TW3CustomScrollBar.setPageSize(aValue: Integer)
   ///  [line: 166, column: 30, file: SmartCL.Controls.ScrollBar]
   ,setPageSize:function(Self, aValue$64) {
      aValue$64 = TInteger.EnsureRange(aValue$64,0,Self.FTotal);
      if (aValue$64!=Self.FPageSize) {
         Self.FPageSize = aValue$64;
         if (Self.FTotal>0) {
            TW3CustomScrollBar.Recalculate$(Self);
            TW3CustomControl.LayoutChildren(Self);
         }
         if (Self.FOnChanged) {
            Self.FOnChanged(Self);
         }
      }
   }
   /// procedure TW3CustomScrollBar.setPosition(aValue: Integer)
   ///  [line: 182, column: 30, file: SmartCL.Controls.ScrollBar]
   ,setPosition:function(Self, aValue$65) {
      aValue$65 = TInteger.EnsureRange(aValue$65,0,(Self.FTotal-Self.FPageSize));
      if (aValue$65!=Self.FPosition) {
         Self.FPosition = aValue$65;
         if (Self.FTotal>0) {
            TW3CustomScrollBar.Recalculate$(Self);
            TW3CustomControl.LayoutChildren(Self);
         }
         if (Self.FOnChanged) {
            Self.FOnChanged(Self);
         }
      }
   }
   /// procedure TW3CustomScrollBar.setPositionNoCalc(aValue: Integer)
   ///  [line: 198, column: 30, file: SmartCL.Controls.ScrollBar]
   ,setPositionNoCalc:function(Self, aValue$66) {
      aValue$66 = TInteger.EnsureRange(aValue$66,0,(Self.FTotal-Self.FPageSize));
      if (aValue$66!=Self.FPosition) {
         Self.FPosition = aValue$66;
         if (Self.FOnChanged) {
            Self.FOnChanged(Self);
         }
      }
   }
   /// procedure TW3CustomScrollBar.setTotal(aValue: Integer)
   ///  [line: 142, column: 30, file: SmartCL.Controls.ScrollBar]
   ,setTotal:function(Self, aValue$67) {
      aValue$67 = TInteger.EnsureRange(aValue$67,0,2147483647);
      if (aValue$67!=Self.FTotal) {
         Self.FTotal = aValue$67;
         if (Self.FPageSize>Self.FTotal) {
            Self.FPageSize = Self.FTotal;
         }
         if (Self.FPosition>(Self.FTotal-Self.FPageSize)) {
            if ((Self.FTotal-Self.FPageSize)<1) {
               Self.FPosition = 0;
            } else {
               Self.FPosition = Self.FTotal-Self.FPageSize;
            }
         }
         TW3CustomScrollBar.Recalculate$(Self);
         TW3CustomControl.LayoutChildren(Self);
         if (Self.FOnChanged) {
            Self.FOnChanged(Self);
         }
      }
   }
   /// function TW3CustomScrollBar.supportAdjustment() : Boolean
   ///  [line: 137, column: 35, file: SmartCL.Controls.ScrollBar]
   ,supportAdjustment:function(Self) {
      var Result = false;
      Result = false;
      return Result
   }
   ,Destroy:TW3TagObj.Destroy
   ,AfterUpdate:TW3CustomControl.AfterUpdate
   ,FinalizeObject$:function($){return $.ClassType.FinalizeObject($)}
   ,InitializeObject$:function($){return $.ClassType.InitializeObject($)}
   ,MakeElementTagId:TW3TagObj.MakeElementTagId
   ,MakeElementTagObj:TW3TagObj.MakeElementTagObj
   ,StyleTagObject:TW3CustomControl.StyleTagObject
   ,ChildAdded:TW3Component.ChildAdded
   ,Create$18:TW3CustomControl.Create$18
   ,GetHeight:TW3MovableControl.GetHeight
   ,GetWidth:TW3MovableControl.GetWidth
   ,Resize:TW3MovableControl.Resize
   ,SetHeight:TW3MovableControl.SetHeight
   ,SetWidth:TW3MovableControl.SetWidth
   ,supportAdjustment$:function($){return $.supportAdjustment($)}
   ,CBClick:TW3CustomControl.CBClick
   ,CBKeyDown:TW3CustomControl.CBKeyDown
   ,CBKeyUp:TW3CustomControl.CBKeyUp
   ,CBMouseDown:TW3CustomControl.CBMouseDown
   ,CBMouseMove:TW3CustomControl.CBMouseMove
   ,CBMouseUp:TW3CustomControl.CBMouseUp
   ,GetEnabled:TW3CustomControl.GetEnabled
   ,Invalidate:TW3CustomControl.Invalidate
   ,SetEnabled:TW3CustomControl.SetEnabled
   ,getArea$:function($){return $.ClassType.getArea($)}
   ,Recalculate$:function($){return $.ClassType.Recalculate($)}
};
/// TW3VerticalScrollbar = class (TW3CustomScrollBar)
///  [line: 58, column: 3, file: SmartCL.Controls.ScrollBar]
var TW3VerticalScrollbar = {
   $ClassName:"TW3VerticalScrollbar",
   $Parent:TW3CustomScrollBar
   ,$Init:function ($) {
      TW3CustomScrollBar.$Init($);
      $.FDragPos = $.FDragSize = $.FEntry = 0;
      $.FMoving = false;
   }
   /// function TW3VerticalScrollbar.getArea() : Integer
   ///  [line: 366, column: 31, file: SmartCL.Controls.ScrollBar]
   ,getArea:function(Self) {
      var Result = 0;
      Result = TW3MovableControl.GetTop(Self.FDownBtn)-1-(TW3MovableControl.GetBoundsRect(Self.FUpBtn).Bottom$1+1);
      return Result
   }
   /// procedure TW3VerticalScrollbar.HandleDragBarMouseDown(Sender: TObject; button: TMouseButton; shiftState: TShiftState; x: Integer; y: Integer)
   ///  [line: 371, column: 32, file: SmartCL.Controls.ScrollBar]
   ,HandleDragBarMouseDown:function(Self, Sender$12, button$5, shiftState$11, x$22, y$9) {
      if (button$5==0) {
         if (TRect$ContainsPos$1(TW3MovableControl.GetBoundsRect(Self.FHandle$4),x$22,y$9)) {
            TW3CustomControl.SetCapture(Self);
            Self.FEntry = y$9-TW3MovableControl.GetTop(Self.FHandle$4);
            Self.FMoving = true;
         } else {
            if ((y$9<TW3MovableControl.GetTop(Self.FHandle$4))&&(!TRect$ContainsPos$1(TW3MovableControl.GetBoundsRect(Self.FUpBtn),x$22,y$9))) {
               TW3CustomScrollBar.setPosition(Self,Self.FPosition-Self.FPageSize);
            } else if ((y$9>TW3MovableControl.GetBoundsRect(Self.FHandle$4).Bottom$1)&&(!TRect$ContainsPos$1(TW3MovableControl.GetBoundsRect(Self.FDownBtn),x$22,y$9))) {
               TW3CustomScrollBar.setPosition(Self,Self.FPosition+Self.FPageSize);
            }
         }
      }
   }
   /// procedure TW3VerticalScrollbar.HandleDragBarMouseMove(Sender: TObject; shiftState: TShiftState; x: Integer; y: Integer)
   ///  [line: 395, column: 32, file: SmartCL.Controls.ScrollBar]
   ,HandleDragBarMouseMove:function(Self, Sender$13, shiftState$12, x$23, y$10) {
      var mNewPos = 0;
      var dy$7 = 0;
      if (Self.FMoving) {
         dy$7 = y$10-Self.FEntry;
         TW3MovableControl.SetTop(Self.FHandle$4,TInteger.EnsureRange(dy$7,TW3MovableControl.GetBoundsRect(Self.FUpBtn).Bottom$1,(TW3MovableControl.GetTop(Self.FDownBtn)-Self.FDragSize)));
         mNewPos = TW3CustomScrollBar.PixelOffsetToPosition(Self,TW3MovableControl.GetTop(Self.FHandle$4)-(TW3MovableControl.GetBoundsRect(Self.FUpBtn).Bottom$1+1));
         TW3CustomScrollBar.setPositionNoCalc(Self,mNewPos);
      }
   }
   /// procedure TW3VerticalScrollbar.HandleDragBarMouseUp(Sender: TObject; button: TMouseButton; shiftState: TShiftState; x: Integer; y: Integer)
   ///  [line: 417, column: 32, file: SmartCL.Controls.ScrollBar]
   ,HandleDragBarMouseUp:function(Self, Sender$14, button$6, shiftState$13, x$24, y$11) {
      if (Self.FMoving) {
         Self.FMoving = false;
         TW3CustomScrollBar.setPosition(Self,TW3CustomScrollBar.PixelOffsetToPosition(Self,TW3MovableControl.GetTop(Self.FHandle$4)-(TW3MovableControl.GetBoundsRect(Self.FUpBtn).Bottom$1+1)));
         TW3CustomControl.ReleaseCapture(Self);
      }
   }
   /// procedure TW3VerticalScrollbar.InitializeObject()
   ///  [line: 350, column: 32, file: SmartCL.Controls.ScrollBar]
   ,InitializeObject:function(Self) {
      TW3CustomScrollBar.InitializeObject(Self);
      Self.FMoving = false;
      TW3CustomControl.SetStyleClass(Self.FUpBtn,"TW3ScrollbarDownBtn");
      TW3CustomControl.SetStyleClass(Self.FDownBtn,"TW3ScrollbarUpBtn");
      TW3CustomControl.SetStyleClass(Self.FHandle$4,"TW3ScrollbarHandle");
      TW3CustomControl._setMouseDown(Self,$Event(Self,TW3VerticalScrollbar.HandleDragBarMouseDown));
      TW3CustomControl._setMouseMove(Self,$Event(Self,TW3VerticalScrollbar.HandleDragBarMouseMove));
      TW3CustomControl._setMouseUp(Self,$Event(Self,TW3VerticalScrollbar.HandleDragBarMouseUp));
   }
   /// procedure TW3VerticalScrollbar.Recalculate()
   ///  [line: 451, column: 32, file: SmartCL.Controls.ScrollBar]
   ,Recalculate:function(Self) {
      Self.FDragSize = TW3CustomScrollBar.calcSizeOfHandle(Self);
      Self.FDragPos = TW3CustomScrollBar.PositionToPixelOffset(Self,Self.FPosition);
   }
   /// procedure TW3VerticalScrollbar.Resize()
   ///  [line: 430, column: 32, file: SmartCL.Controls.ScrollBar]
   ,Resize:function(Self) {
      var mTop = 0;
      TW3MovableControl.Resize(Self);
      TW3MovableControl.SetBounds$2(Self.FUpBtn,0,0,TW3MovableControl.ClientWidth(Self),28);
      TW3MovableControl.SetBounds$2(Self.FDownBtn,0,TW3MovableControl.ClientHeight(Self)-28,TW3MovableControl.ClientWidth(Self),28);
      TW3CustomScrollBar.Recalculate$(Self);
      if ((Self.FTotal<1)||(Self.FDragPos<0)) {
         TW3MovableControl.SetVisible(Self.FHandle$4,false);
      } else {
         TW3MovableControl.SetVisible(Self.FHandle$4,true);
      }
      mTop = TW3MovableControl.GetTop(Self.FUpBtn)+TW3MovableControl.GetHeight$(Self.FUpBtn)+1+Self.FDragPos;
      TW3MovableControl.SetBounds$2(Self.FHandle$4,2,mTop,TW3MovableControl.ClientWidth(Self)-4,Self.FDragSize);
   }
   ,Destroy:TW3TagObj.Destroy
   ,AfterUpdate:TW3CustomControl.AfterUpdate
   ,FinalizeObject:TW3CustomScrollBar.FinalizeObject
   ,InitializeObject$:function($){return $.ClassType.InitializeObject($)}
   ,MakeElementTagId:TW3TagObj.MakeElementTagId
   ,MakeElementTagObj:TW3TagObj.MakeElementTagObj
   ,StyleTagObject:TW3CustomControl.StyleTagObject
   ,ChildAdded:TW3Component.ChildAdded
   ,Create$18:TW3CustomControl.Create$18
   ,GetHeight:TW3MovableControl.GetHeight
   ,GetWidth:TW3MovableControl.GetWidth
   ,Resize$:function($){return $.ClassType.Resize($)}
   ,SetHeight:TW3MovableControl.SetHeight
   ,SetWidth:TW3MovableControl.SetWidth
   ,supportAdjustment:TW3CustomScrollBar.supportAdjustment
   ,CBClick:TW3CustomControl.CBClick
   ,CBKeyDown:TW3CustomControl.CBKeyDown
   ,CBKeyUp:TW3CustomControl.CBKeyUp
   ,CBMouseDown:TW3CustomControl.CBMouseDown
   ,CBMouseMove:TW3CustomControl.CBMouseMove
   ,CBMouseUp:TW3CustomControl.CBMouseUp
   ,GetEnabled:TW3CustomControl.GetEnabled
   ,Invalidate:TW3CustomControl.Invalidate
   ,SetEnabled:TW3CustomControl.SetEnabled
   ,getArea$:function($){return $.ClassType.getArea($)}
   ,Recalculate$:function($){return $.ClassType.Recalculate($)}
};
/// TW3ScrollbarLowerBtn = class (TW3CustomControl)
///  [line: 20, column: 3, file: SmartCL.Controls.ScrollBar]
var TW3ScrollbarLowerBtn = {
   $ClassName:"TW3ScrollbarLowerBtn",
   $Parent:TW3CustomControl
   ,$Init:function ($) {
      TW3CustomControl.$Init($);
   }
   ,Destroy:TW3TagObj.Destroy
   ,AfterUpdate:TW3CustomControl.AfterUpdate
   ,FinalizeObject:TW3CustomControl.FinalizeObject
   ,InitializeObject:TW3CustomControl.InitializeObject
   ,MakeElementTagId:TW3TagObj.MakeElementTagId
   ,MakeElementTagObj:TW3TagObj.MakeElementTagObj
   ,StyleTagObject:TW3CustomControl.StyleTagObject
   ,ChildAdded:TW3Component.ChildAdded
   ,Create$18:TW3CustomControl.Create$18
   ,GetHeight:TW3MovableControl.GetHeight
   ,GetWidth:TW3MovableControl.GetWidth
   ,Resize:TW3MovableControl.Resize
   ,SetHeight:TW3MovableControl.SetHeight
   ,SetWidth:TW3MovableControl.SetWidth
   ,supportAdjustment:TW3MovableControl.supportAdjustment
   ,CBClick:TW3CustomControl.CBClick
   ,CBKeyDown:TW3CustomControl.CBKeyDown
   ,CBKeyUp:TW3CustomControl.CBKeyUp
   ,CBMouseDown:TW3CustomControl.CBMouseDown
   ,CBMouseMove:TW3CustomControl.CBMouseMove
   ,CBMouseUp:TW3CustomControl.CBMouseUp
   ,GetEnabled:TW3CustomControl.GetEnabled
   ,Invalidate:TW3CustomControl.Invalidate
   ,SetEnabled:TW3CustomControl.SetEnabled
};
/// TW3ScrollbarHigherBtn = class (TW3CustomControl)
///  [line: 21, column: 3, file: SmartCL.Controls.ScrollBar]
var TW3ScrollbarHigherBtn = {
   $ClassName:"TW3ScrollbarHigherBtn",
   $Parent:TW3CustomControl
   ,$Init:function ($) {
      TW3CustomControl.$Init($);
   }
   ,Destroy:TW3TagObj.Destroy
   ,AfterUpdate:TW3CustomControl.AfterUpdate
   ,FinalizeObject:TW3CustomControl.FinalizeObject
   ,InitializeObject:TW3CustomControl.InitializeObject
   ,MakeElementTagId:TW3TagObj.MakeElementTagId
   ,MakeElementTagObj:TW3TagObj.MakeElementTagObj
   ,StyleTagObject:TW3CustomControl.StyleTagObject
   ,ChildAdded:TW3Component.ChildAdded
   ,Create$18:TW3CustomControl.Create$18
   ,GetHeight:TW3MovableControl.GetHeight
   ,GetWidth:TW3MovableControl.GetWidth
   ,Resize:TW3MovableControl.Resize
   ,SetHeight:TW3MovableControl.SetHeight
   ,SetWidth:TW3MovableControl.SetWidth
   ,supportAdjustment:TW3MovableControl.supportAdjustment
   ,CBClick:TW3CustomControl.CBClick
   ,CBKeyDown:TW3CustomControl.CBKeyDown
   ,CBKeyUp:TW3CustomControl.CBKeyUp
   ,CBMouseDown:TW3CustomControl.CBMouseDown
   ,CBMouseMove:TW3CustomControl.CBMouseMove
   ,CBMouseUp:TW3CustomControl.CBMouseUp
   ,GetEnabled:TW3CustomControl.GetEnabled
   ,Invalidate:TW3CustomControl.Invalidate
   ,SetEnabled:TW3CustomControl.SetEnabled
};
/// TW3ScrollbarHandle = class (TW3CustomControl)
///  [line: 22, column: 3, file: SmartCL.Controls.ScrollBar]
var TW3ScrollbarHandle = {
   $ClassName:"TW3ScrollbarHandle",
   $Parent:TW3CustomControl
   ,$Init:function ($) {
      TW3CustomControl.$Init($);
   }
   ,Destroy:TW3TagObj.Destroy
   ,AfterUpdate:TW3CustomControl.AfterUpdate
   ,FinalizeObject:TW3CustomControl.FinalizeObject
   ,InitializeObject:TW3CustomControl.InitializeObject
   ,MakeElementTagId:TW3TagObj.MakeElementTagId
   ,MakeElementTagObj:TW3TagObj.MakeElementTagObj
   ,StyleTagObject:TW3CustomControl.StyleTagObject
   ,ChildAdded:TW3Component.ChildAdded
   ,Create$18:TW3CustomControl.Create$18
   ,GetHeight:TW3MovableControl.GetHeight
   ,GetWidth:TW3MovableControl.GetWidth
   ,Resize:TW3MovableControl.Resize
   ,SetHeight:TW3MovableControl.SetHeight
   ,SetWidth:TW3MovableControl.SetWidth
   ,supportAdjustment:TW3MovableControl.supportAdjustment
   ,CBClick:TW3CustomControl.CBClick
   ,CBKeyDown:TW3CustomControl.CBKeyDown
   ,CBKeyUp:TW3CustomControl.CBKeyUp
   ,CBMouseDown:TW3CustomControl.CBMouseDown
   ,CBMouseMove:TW3CustomControl.CBMouseMove
   ,CBMouseUp:TW3CustomControl.CBMouseUp
   ,GetEnabled:TW3CustomControl.GetEnabled
   ,Invalidate:TW3CustomControl.Invalidate
   ,SetEnabled:TW3CustomControl.SetEnabled
};
/// TW3HorizontalScrollbar = class (TW3CustomScrollBar)
///  [line: 78, column: 3, file: SmartCL.Controls.ScrollBar]
var TW3HorizontalScrollbar = {
   $ClassName:"TW3HorizontalScrollbar",
   $Parent:TW3CustomScrollBar
   ,$Init:function ($) {
      TW3CustomScrollBar.$Init($);
      $.FDragPos$1 = $.FDragSize$1 = $.FEntry$1 = 0;
      $.FMoving$1 = false;
   }
   /// function TW3HorizontalScrollbar.getArea() : Integer
   ///  [line: 255, column: 33, file: SmartCL.Controls.ScrollBar]
   ,getArea:function(Self) {
      var Result = 0;
      Result = TW3MovableControl.GetLeft(Self.FDownBtn)-1-(TW3MovableControl.GetBoundsRect(Self.FUpBtn).Right$1+1);
      return Result
   }
   /// procedure TW3HorizontalScrollbar.HandleDragBarMouseDown(Sender: TObject; button: TMouseButton; shiftState: TShiftState; x: Integer; y: Integer)
   ///  [line: 260, column: 34, file: SmartCL.Controls.ScrollBar]
   ,HandleDragBarMouseDown$1:function(Self, Sender$15, button$7, shiftState$14, x$25, y$12) {
      if (button$7==0) {
         if (TRect$ContainsPos$1(TW3MovableControl.GetBoundsRect(Self.FHandle$4),x$25,y$12)) {
            TW3CustomControl.SetCapture(Self);
            Self.FEntry$1 = x$25-TW3MovableControl.GetLeft(Self.FHandle$4);
            Self.FMoving$1 = true;
         } else {
            if ((x$25<TW3MovableControl.GetLeft(Self.FHandle$4))&&(!TRect$ContainsPos$1(TW3MovableControl.GetBoundsRect(Self.FUpBtn),x$25,y$12))) {
               TW3CustomScrollBar.setPosition(Self,Self.FPosition-Self.FPageSize);
            } else if ((x$25>TW3MovableControl.GetBoundsRect(Self.FHandle$4).Right$1)&&(!TRect$ContainsPos$1(TW3MovableControl.GetBoundsRect(Self.FDownBtn),x$25,y$12))) {
               TW3CustomScrollBar.setPosition(Self,Self.FPosition+Self.FPageSize);
            }
         }
      }
   }
   /// procedure TW3HorizontalScrollbar.HandleDragBarMouseMove(Sender: TObject; shiftState: TShiftState; x: Integer; y: Integer)
   ///  [line: 284, column: 34, file: SmartCL.Controls.ScrollBar]
   ,HandleDragBarMouseMove$1:function(Self, Sender$16, shiftState$15, x$26, y$13) {
      var mNewPos$1 = 0;
      var dx$6 = 0;
      if (Self.FMoving$1) {
         dx$6 = x$26-Self.FEntry$1;
         TW3MovableControl.SetLeft(Self.FHandle$4,TInteger.EnsureRange(dx$6,TW3MovableControl.GetBoundsRect(Self.FUpBtn).Right$1,(TW3MovableControl.GetLeft(Self.FDownBtn)-Self.FDragSize$1)));
         mNewPos$1 = TW3CustomScrollBar.PixelOffsetToPosition(Self,TW3MovableControl.GetLeft(Self.FHandle$4)-(TW3MovableControl.GetBoundsRect(Self.FUpBtn).Right$1+1));
         TW3CustomScrollBar.setPositionNoCalc(Self,mNewPos$1);
      }
   }
   /// procedure TW3HorizontalScrollbar.HandleDragBarMouseUp(Sender: TObject; button: TMouseButton; shiftState: TShiftState; x: Integer; y: Integer)
   ///  [line: 306, column: 34, file: SmartCL.Controls.ScrollBar]
   ,HandleDragBarMouseUp$1:function(Self, Sender$17, button$8, shiftState$16, x$27, y$14) {
      if (Self.FMoving$1) {
         Self.FMoving$1 = false;
         TW3CustomScrollBar.setPosition(Self,TW3CustomScrollBar.PixelOffsetToPosition(Self,TW3MovableControl.GetLeft(Self.FHandle$4)-(TW3MovableControl.GetBoundsRect(Self.FUpBtn).Right$1+1)));
         TW3CustomControl.ReleaseCapture(Self);
      }
   }
   /// procedure TW3HorizontalScrollbar.InitializeObject()
   ///  [line: 237, column: 34, file: SmartCL.Controls.ScrollBar]
   ,InitializeObject:function(Self) {
      TW3CustomScrollBar.InitializeObject(Self);
      Self.FMoving$1 = false;
      TW3CustomControl.SetStyleClass(Self.FUpBtn,"TW3ScrollbarLeftBtn");
      TW3CustomControl.SetStyleClass(Self.FDownBtn,"TW3ScrollbarRightBtn");
      TW3CustomControl.SetStyleClass(Self.FHandle$4,"TW3ScrollbarHandle");
      TW3CustomControl._setMouseDown(Self,$Event(Self,TW3HorizontalScrollbar.HandleDragBarMouseDown$1));
      TW3CustomControl._setMouseMove(Self,$Event(Self,TW3HorizontalScrollbar.HandleDragBarMouseMove$1));
      TW3CustomControl._setMouseUp(Self,$Event(Self,TW3HorizontalScrollbar.HandleDragBarMouseUp$1));
   }
   /// procedure TW3HorizontalScrollbar.Recalculate()
   ///  [line: 339, column: 34, file: SmartCL.Controls.ScrollBar]
   ,Recalculate:function(Self) {
      Self.FDragSize$1 = TW3CustomScrollBar.calcSizeOfHandle(Self);
      Self.FDragPos$1 = TW3CustomScrollBar.PositionToPixelOffset(Self,Self.FPosition);
   }
   /// procedure TW3HorizontalScrollbar.Resize()
   ///  [line: 318, column: 34, file: SmartCL.Controls.ScrollBar]
   ,Resize:function(Self) {
      var mLeft = 0;
      TW3MovableControl.Resize(Self);
      TW3MovableControl.SetBounds$2(Self.FUpBtn,0,0,28,TW3MovableControl.ClientHeight(Self));
      TW3MovableControl.SetBounds$2(Self.FDownBtn,TW3MovableControl.ClientWidth(Self)-28,0,28,TW3MovableControl.ClientHeight(Self));
      TW3CustomScrollBar.Recalculate$(Self);
      if ((Self.FTotal<1)||(Self.FDragPos$1<0)) {
         TW3MovableControl.SetVisible(Self.FHandle$4,false);
      } else {
         TW3MovableControl.SetVisible(Self.FHandle$4,true);
      }
      mLeft = TW3MovableControl.GetLeft(Self.FUpBtn)+TW3MovableControl.GetWidth$(Self.FUpBtn)+1+Self.FDragPos$1;
      TW3MovableControl.SetBounds$2(Self.FHandle$4,mLeft,2,Self.FDragSize$1,TW3MovableControl.ClientHeight(Self)-4);
   }
   ,Destroy:TW3TagObj.Destroy
   ,AfterUpdate:TW3CustomControl.AfterUpdate
   ,FinalizeObject:TW3CustomScrollBar.FinalizeObject
   ,InitializeObject$:function($){return $.ClassType.InitializeObject($)}
   ,MakeElementTagId:TW3TagObj.MakeElementTagId
   ,MakeElementTagObj:TW3TagObj.MakeElementTagObj
   ,StyleTagObject:TW3CustomControl.StyleTagObject
   ,ChildAdded:TW3Component.ChildAdded
   ,Create$18:TW3CustomControl.Create$18
   ,GetHeight:TW3MovableControl.GetHeight
   ,GetWidth:TW3MovableControl.GetWidth
   ,Resize$:function($){return $.ClassType.Resize($)}
   ,SetHeight:TW3MovableControl.SetHeight
   ,SetWidth:TW3MovableControl.SetWidth
   ,supportAdjustment:TW3CustomScrollBar.supportAdjustment
   ,CBClick:TW3CustomControl.CBClick
   ,CBKeyDown:TW3CustomControl.CBKeyDown
   ,CBKeyUp:TW3CustomControl.CBKeyUp
   ,CBMouseDown:TW3CustomControl.CBMouseDown
   ,CBMouseMove:TW3CustomControl.CBMouseMove
   ,CBMouseUp:TW3CustomControl.CBMouseUp
   ,GetEnabled:TW3CustomControl.GetEnabled
   ,Invalidate:TW3CustomControl.Invalidate
   ,SetEnabled:TW3CustomControl.SetEnabled
   ,getArea$:function($){return $.ClassType.getArea($)}
   ,Recalculate$:function($){return $.ClassType.Recalculate($)}
};
var vColorNames = [];
var vColorNames = ["aqua", "black", "blue", "fuchsia", "green", "gray", "lime", "maroon", "navy", "olive", "purple", "red", "silver", "teal", "white", "yellow"].slice();
var vColorValues = [];
var vColorValues = ["#0ff", "#000", "#00f", "#f0f", "#008000", "#808080", "#0f0", "#800000", "#000080", "#808000", "#800080", "#f00", "#c0c0c0", "#008080", "#fff", "#ff00"].slice();
var vCurrent = null;
var vScheduledControls = [];
var vScheduledCallbacks = [];
var vOnPerform = [];
var vPending = false;
var RegisterComponentsProc = null;
var DefaultDuration = 0;
var DefaultDuration = 2;
var DefaultTiming = 0;
var DefaultTiming = 1;
var vGetNow = undefined;
var vIsHighResolution = false;
var PressedCSSClass = "";
var PressedCSSClass = "TW3Button_Pressed";
var Instance = null;
var vCaptureControl = null;
var vCaptureInitialized = false;
var Application$1 = null;
var GAnimationManager = null;
var GlobalRepeaterList = [];
var GForms = null;
var vUniqueNumber = 0;
var vVendor = 0;
var vDriver = null;
var vRequestAnimFrame = null;
var vCancelAnimFrame = null;
var $Application = function() {
   Application$1 = TW3CustomApplication.Create$20($New(TW3CustomApplication));
   TW3CustomApplication.CreateForm(Application$1,TPaintBoxForm,true);
   TW3CustomApplication.RunApp(Application$1);
}
$Application();


      };
      myApp();
    }
  </script>
</head>

<body></body>



</html>
